Package com.consol.citrus.kafka.message
Class KafkaMessage
- java.lang.Object
-
- com.consol.citrus.message.DefaultMessage
-
- com.consol.citrus.kafka.message.KafkaMessage
-
- All Implemented Interfaces:
Message,Serializable
public class KafkaMessage extends DefaultMessage
- Since:
- 2.8
- Author:
- Christoph Deppisch
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KafkaMessage()Empty constructor initializing with empty message payload.KafkaMessage(Object payload)Default constructor using message payload.KafkaMessage(Object payload, Map<String,Object> headers)Default constructor using payload and headers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetMessageKey()Gets the Kafka message key header.LonggetOffset()Gets the Kafka offset header.IntegergetPartition()Gets the Kafka partition header.LonggetTimestamp()Gets the Kafka timestamp header.StringgetTopic()Gets the Kafka topic header.KafkaMessagemessageKey(Object key)Sets the Kafka message key header.KafkaMessageoffset(long offset)Sets the Kafka offset header.KafkaMessagepartition(int partition)Sets the Kafka partition id header.KafkaMessagetimestamp(Long timestamp)Sets the Kafka timestamp header.KafkaMessagetopic(String topic)Sets the Kafka topic key header.-
Methods inherited from class com.consol.citrus.message.DefaultMessage
addHeaderData, getHeader, getHeaderData, getHeaders, getId, getName, getPayload, getPayload, getType, removeHeader, setHeader, setName, setPayload, setType, setType, toString
-
-
-
-
Constructor Detail
-
KafkaMessage
public KafkaMessage()
Empty constructor initializing with empty message payload.
-
KafkaMessage
public KafkaMessage(Object payload, Map<String,Object> headers)
Default constructor using payload and headers.- Parameters:
payload-headers-
-
KafkaMessage
public KafkaMessage(Object payload)
Default constructor using message payload.- Parameters:
payload-
-
-
Method Detail
-
partition
public KafkaMessage partition(int partition)
Sets the Kafka partition id header.- Parameters:
partition-
-
timestamp
public KafkaMessage timestamp(Long timestamp)
Sets the Kafka timestamp header.- Parameters:
timestamp-
-
offset
public KafkaMessage offset(long offset)
Sets the Kafka offset header.- Parameters:
offset-
-
messageKey
public KafkaMessage messageKey(Object key)
Sets the Kafka message key header.- Parameters:
key-
-
topic
public KafkaMessage topic(String topic)
Sets the Kafka topic key header.- Parameters:
topic-
-
getPartition
public Integer getPartition()
Gets the Kafka partition header.- Returns:
-
getTimestamp
public Long getTimestamp()
Gets the Kafka timestamp header.- Overrides:
getTimestampin classDefaultMessage- Returns:
-
getOffset
public Long getOffset()
Gets the Kafka offset header.- Returns:
-
getMessageKey
public Object getMessageKey()
Gets the Kafka message key header.- Returns:
-
getTopic
public String getTopic()
Gets the Kafka topic header.- Returns:
-
-