Package com.rabbitmq.client
Class GetResponse
- java.lang.Object
-
- com.rabbitmq.client.GetResponse
-
public class GetResponse extends Object
Encapsulates the response from aChannel.basicGet(java.lang.String, boolean)
message-retrieval method call - essentially a static bean "holder" with message response data.
-
-
Constructor Summary
Constructors Constructor Description GetResponse(Envelope envelope, AMQP.BasicProperties props, byte[] body, int messageCount)
Construct aGetResponse
with the specified construction parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBody()
Get the message body included in this responseEnvelope
getEnvelope()
Get theEnvelope
included in this responseint
getMessageCount()
Get the server's most recent estimate of the number of messages remaining on the queue.AMQP.BasicProperties
getProps()
Get theAMQP.BasicProperties
included in this responseString
toString()
-
-
-
Constructor Detail
-
GetResponse
public GetResponse(Envelope envelope, AMQP.BasicProperties props, byte[] body, int messageCount)
Construct aGetResponse
with the specified construction parameters- Parameters:
envelope
- theEnvelope
props
- message propertiesbody
- the message bodymessageCount
- the server's most recent estimate of the number of messages remaining on the queue
-
-
Method Detail
-
getEnvelope
public Envelope getEnvelope()
Get theEnvelope
included in this response- Returns:
- the envelope
-
getProps
public AMQP.BasicProperties getProps()
Get theAMQP.BasicProperties
included in this response- Returns:
- the properties
-
getBody
public byte[] getBody()
Get the message body included in this response- Returns:
- the message body
-
getMessageCount
public int getMessageCount()
Get the server's most recent estimate of the number of messages remaining on the queue. This number can only ever be a rough estimate, because of concurrent activity at the server and the delay between the server sending its estimate and the client receiving and processing the message containing the estimate.According to the AMQP specification, this figure does not include the message being delivered. For example, this field will be zero in the simplest case of a single reader issuing a Basic.Get on a private queue holding a single message (the message being delivered in this GetResponse).
- Returns:
- an estimate of the number of messages remaining to be read from the queue
-
-