Package 

Class Message

  • All Implemented Interfaces:

    
    public final class Message
    extends Frame
                        

    An abstract implementation that represents a message sent from nsqd to the client.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Message.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Instant getTimestamp() The timestamp of this message.
      final Boolean isFinished() Whether or not this message was already confirmed as finished via a message to nsqd or not.
      final Boolean isRequeued() Whether or not this message was already requeued at nsqd.
      final String getTopic()
      final Integer getAttempts() The amount of attempts that already happened for this message.
      final String getId() A unique identifier of the message mainly used for sending an acknowledgement.
      final ByteArray getData() The data payload of the message.
      final Unit finish() Finish this message for good.
      final Unit requeue(Duration delay) Requeue this message at nsqd.
      final Unit touch() Touch this message to reset the processing timeout.
      • Methods inherited from class com.abusix.knsq.protocol.Frame

        getSize, getType
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getTimestamp

         final Instant getTimestamp()

        The timestamp of this message. Keep in mind that this is an implementation detail of nsqd and has no guarantees.

      • isFinished

         final Boolean isFinished()

        Whether or not this message was already confirmed as finished via a message to nsqd or not. If this is true, finish, requeue and touch will be without effect.

      • isRequeued

         final Boolean isRequeued()

        Whether or not this message was already requeued at nsqd. Keep in mind that this does not take the server-side timeout into effect. If this is true, finish, requeue and touch will be without effect.

      • getAttempts

         final Integer getAttempts()

        The amount of attempts that already happened for this message. The current attempt is included.

      • getId

         final String getId()

        A unique identifier of the message mainly used for sending an acknowledgement.

      • finish

         final Unit finish()

        Finish this message for good. This means that nsqd won't send this message again and drops it if no other clients have this message still pending.

      • requeue

         final Unit requeue(Duration delay)

        Requeue this message at nsqd. The message will usually will be appended to the end of the queue there. However, this is no guaranteed behaviour of nsqd.

      • touch

         final Unit touch()

        Touch this message to reset the processing timeout. Use this if your client implementation performs manual finish calls that might happen after a while.