Package io.micronaut.rabbitmq.bind
Class RabbitConsumerState
java.lang.Object
io.micronaut.rabbitmq.bind.RabbitConsumerState
Stores the state of a RabbitMQ message to be consumed.
This class should be treated as immutable.
- Since:
- 1.1.0
- Author:
- James Kleeh
-
Constructor Summary
ConstructorDescriptionRabbitConsumerState
(com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body, com.rabbitmq.client.Channel channel) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBody()
com.rabbitmq.client.Channel
This channel is being used exclusively by the consumer that consumed this message.@NonNull com.rabbitmq.client.Envelope
com.rabbitmq.client.AMQP.BasicProperties
-
Constructor Details
-
RabbitConsumerState
public RabbitConsumerState(com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body, com.rabbitmq.client.Channel channel) Default constructor.- Parameters:
envelope
- The envelopeproperties
- The propertiesbody
- The bodychannel
- The channel that consumed the message
-
-
Method Details
-
getBody
public byte[] getBody()- Returns:
- The body
-
getProperties
@NonNull public com.rabbitmq.client.AMQP.BasicProperties getProperties()- Returns:
- The properties
-
getEnvelope
@NonNull public @NonNull com.rabbitmq.client.Envelope getEnvelope()- Returns:
- The envelope
-
getChannel
public com.rabbitmq.client.Channel getChannel()This channel is being used exclusively by the consumer that consumed this message. Attempts to use this channel for any purpose other than acknowledgement may result in errors because channels are not thread safe.- Returns:
- The channel
-