Examples of AMQBody


Examples of org.apache.qpid.framing.AMQBody

        }
    }

    public void writeGetOk(QueueEntry entry, int channelId, long deliveryTag, int queueSize) throws AMQException
    {
        AMQBody deliver = createEncodedGetOkBody(entry, deliveryTag, queueSize);
        writeMessageDelivery(convertToAMQMessage(entry), channelId, deliver);
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        final MessagePublishInfo pb = message.getMessagePublishInfo();
        exchangeName = pb.getExchange();
        routingKey = pb.getRoutingKey();

        final AMQBody returnBlock = new EncodedDeliveryBody(deliveryTag, routingKey, exchangeName, consumerTag, isRedelivered);
        return returnBlock;
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    public void writeReturn(MessagePublishInfo messagePublishInfo, ContentHeaderBody header, MessageContentSource message, int channelId, int replyCode, AMQShortString replyText)
            throws AMQException
    {

        AMQBody returnFrame = createEncodedReturnFrame(messagePublishInfo, replyCode, replyText);

        writeMessageDelivery(message, header, channelId, returnFrame);
    }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    public void setUp() throws Exception
    {
        //Create a new ProtocolHandler with a fake connection.
        _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='tcp://localhost:1'"));
        _handler.setNetworkConnection(new TestNetworkConnection());
         AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1);
        _blockFrame = new AMQFrame(0, body);

        _handleCountDown = new CountDownLatch(1);

        _logger.info("Creating _Listener that should also receive the thrown exception.");
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

                                    _logger.debug("Received " + _messageReceivedCount + " protocol messages");
                                }

                                AMQFrame frame = (AMQFrame) message;

                                final AMQBody bodyFrame = frame.getBodyFrame();

                                HeartbeatDiagnostics.received(bodyFrame instanceof HeartbeatBody);

                                bodyFrame.handle(frame.getChannel(), _protocolSession);

                                _connection.bytesReceived(_readBytes);
                            }
                            else if (message instanceof ProtocolInitiation)
                            {
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    }

    private void frameReceived(AMQFrame frame) throws AMQException
    {
        int channelId = frame.getChannel();
        AMQBody body = frame.getBodyFrame();

        //Look up the Channel's Actor and set that as the current actor
        // If that is not available then we can use the ConnectionActor
        // that is associated with this AMQMPSession.
        LogActor channelActor = null;
        if (_channelMap.get(channelId) != null)
        {
            channelActor = _channelMap.get(channelId).getLogActor();
        }
        CurrentActor.set(channelActor == null ? _actor : channelActor);

        try
        {
            if (_logger.isDebugEnabled())
            {
                _logger.debug("Frame Received: " + frame);
            }

            // Check that this channel is not closing
            if (channelAwaitingClosure(channelId))
            {
                if ((frame.getBodyFrame() instanceof ChannelCloseOkBody))
                {
                    if (_logger.isInfoEnabled())
                    {
                        _logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
                    }
                }
                else
                {
                    // The channel has been told to close, we don't process any more frames until
                    // it's closed.
                    return;
                }
            }

            try
            {
                body.handle(channelId, this);
            }
            catch (AMQException e)
            {
                closeChannel(channelId);
                throw e;
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

            // Not an error. The frame is probably a channel Open for this channel id, which
            // does not require asynchronous work therefore its absence from
            // _channelsForCurrentMessage is ok.
        }

        AMQBody body = frame.getBodyFrame();

        //Look up the Channel's Actor and set that as the current actor
        // If that is not available then we can use the ConnectionActor
        // that is associated with this AMQMPSession.
        LogActor channelActor = null;
        if (amqChannel != null)
        {
            channelActor = amqChannel.getLogActor();
        }
        CurrentActor.set(channelActor == null ? _actor : channelActor);

        try
        {
            long startTime = 0;
            String frameToString = null;
            if (_logger.isDebugEnabled())
            {
                startTime = System.currentTimeMillis();
                frameToString = frame.toString();
                _logger.debug("RECV: " + frame);
            }

            // Check that this channel is not closing
            if (channelAwaitingClosure(channelId))
            {
                if ((frame.getBodyFrame() instanceof ChannelCloseOkBody))
                {
                    if (_logger.isInfoEnabled())
                    {
                        _logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
                    }
                }
                else
                {
                    // The channel has been told to close, we don't process any more frames until
                    // it's closed.
                    return;
                }
            }

            try
            {
                body.handle(channelId, this);
            }
            catch(AMQConnectionException e)
            {
                _logger.info(e.getMessage() + " whilst processing frame: " + body);
                closeConnection(channelId, e);
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

        public AMQDataBlock next()
        {
            try
            {

                AMQBody cb =
                        getProtocolVersionMethodConverter().convertToBody(_messageHandle.getContentChunk(getStoreContext(),
                                                                                                         ++_index));

                return new AMQFrame(_channel, cb);
            }
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

    public void setUp() throws Exception
    {
        //Create a new ProtocolHandler with a fake connection.
        _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='tcp://localhost:1'"));
        _handler.setNetworkConnection(new TestNetworkConnection());
         AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1);
        _blockFrame = new AMQFrame(0, body);

        _handleCountDown = new CountDownLatch(1);

        _logger.info("Creating _Listener that should also receive the thrown exception.");
View Full Code Here

Examples of org.apache.qpid.framing.AMQBody

            _logger.debug("Received " + _messageReceivedCount + " protocol messages");
        }

        AMQFrame frame = (AMQFrame) message;

        final AMQBody bodyFrame = frame.getBodyFrame();

        HeartbeatDiagnostics.received(bodyFrame instanceof HeartbeatBody);

        switch (bodyFrame.getFrameType())
        {
        case AMQMethodBody.TYPE:

            if (debug)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.