Class KafkaMessage

    • 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:
      • 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: