Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 //  The contents of this file are subject to the Mozilla Public License
 //  Version 1.1 (the "License"); you may not use this file except in
 //  compliance with the License. You may obtain a copy of the License
 //  at http://www.mozilla.org/MPL/
 //
 //  Software distributed under the License is distributed on an "AS IS"
 //  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 //  the License for the specific language governing rights and
 //  limitations under the License.
//
//  The Original Code is RabbitMQ.
//
//  The Initial Developer of the Original Code is VMware, Inc.
//  Copyright (c) 2007-2011 VMware, Inc.  All rights reserved.
//
package com.rabbitmq.client;
Encapsulates the response from a Channel.basicGet(java.lang.String,boolean) message-retrieval method call - essentially a static bean "holder" with message response data.
public class GetResponse {
    private final Envelope envelope;
    private final BasicProperties props;
    private final byte[] body;
    private final int messageCount;

    
Construct a GetResponse with the specified construction parameters

Parameters:
envelope the Envelope
props message properties
body the message body
messageCount the server's most recent estimate of the number of messages remaining on the queue
    public GetResponse(Envelope envelopeBasicProperties propsbyte[] bodyint messageCount)
    {
        this. = envelope;
        this. = props;
        this. = body;
        this. = messageCount;
    }

    
Get the Envelope included in this response

Returns:
the envelope
    public Envelope getEnvelope() {
        return ;
    }

    
Get the AMQP.BasicProperties included in this response

Returns:
the properties
    public BasicProperties getProps() {
        return ;
    }

    
Get the message body included in this response

Returns:
the message body
    public byte[] getBody() {
        return ;
    }

    
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
    public int getMessageCount() {
        return ;
    }
New to GrepCode? Check out our FAQ X