Class ShareGroupAcknowledgement

java.lang.Object
io.smallrye.reactive.messaging.kafka.queues.ShareGroupAcknowledgement

public class ShareGroupAcknowledgement extends Object
Metadata for specifying the acknowledgment type when using Kafka Share Groups.

This metadata can be attached to a message when calling nack() to control how the share group consumer should handle the rejected message.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ShareGroupAcknowledgement(org.apache.kafka.clients.consumer.AcknowledgeType acknowledgeType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Accepts the message, indicating that it has been processed successfully
    from(org.apache.kafka.clients.consumer.AcknowledgeType acknowledgeType)
    Creates a ShareGroupAcknowledgeTypeMetadata with the specified acknowledge type.
    org.apache.kafka.clients.consumer.AcknowledgeType
     
    void
    Rejects the message, indicating that it should not be processed and should be discarded
    void
    Releases the message, indicating that it should be reprocessed by another consumer in the share group

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShareGroupAcknowledgement

      public ShareGroupAcknowledgement(org.apache.kafka.clients.consumer.AcknowledgeType acknowledgeType)
    • ShareGroupAcknowledgement

      public ShareGroupAcknowledgement()
  • Method Details

    • accept

      public void accept()
      Accepts the message, indicating that it has been processed successfully
    • release

      public void release()
      Releases the message, indicating that it should be reprocessed by another consumer in the share group
    • reject

      public void reject()
      Rejects the message, indicating that it should not be processed and should be discarded
    • from

      public static ShareGroupAcknowledgement from(org.apache.kafka.clients.consumer.AcknowledgeType acknowledgeType)
      Creates a ShareGroupAcknowledgeTypeMetadata with the specified acknowledge type.
      Parameters:
      acknowledgeType - the acknowledgment type
      Returns:
      the metadata instance
    • getAcknowledgeType

      public org.apache.kafka.clients.consumer.AcknowledgeType getAcknowledgeType()