Package org.apache.qpid.server.message

Examples of org.apache.qpid.server.message.AMQMessage



                    ServerTransaction txn = new LocalTransaction(_messageStore);
                    Collection<QueueEntry> entries = new ArrayList<QueueEntry>(1);
                    entries.add(entry);
                    final AMQMessage message = (AMQMessage) entry.getMessage();
                    txn.dequeue(_queue, entry.getMessage(),
                                new MessageAcknowledgeAction(entries)
                                {
                                    @Override
                                    public void postCommit()
                                    {
                                        try
                                        {
                                            final
                                            ProtocolOutputConverter outputConverter =
                                                    _session.getProtocolOutputConverter();

                                            outputConverter.writeReturn(message.getMessagePublishInfo(),
                                                                        message.getContentHeaderBody(),
                                                                        message,
                                                                        _channelId,
                                                                        AMQConstant.NO_CONSUMERS.getCode(),
                                                                        IMMEDIATE_DELIVERY_REPLY_TEXT);
                                        }
View Full Code Here


            }
        }

        if (_noLocal)
        {
            AMQMessage message = (AMQMessage) entry.getMessage();

            final Object publisherReference = message.getConnectionIdentifier();

            // We don't want local messages so check to see if message is one we sent
            Object localReference = getProtocolSession().getReference();

            if(publisherReference != null && publisherReference.equals(localReference))
View Full Code Here

    private AMQMessage createAMQMessage(IncomingMessage incomingMessage)
            throws AMQException
    {

        AMQMessage message = new AMQMessage(incomingMessage.getStoredMessage());

        message.setExpiration(incomingMessage.getExpiration());
        message.setConnectionIdentifier(_session.getReference());
        return message;
    }
View Full Code Here

            xfr = batch ? new MessageTransfer(_destination,_acceptMode,_acquireMode,header,msg.getBody(), BATCHED)
                        : new MessageTransfer(_destination,_acceptMode,_acquireMode,header,msg.getBody());
        }
        else if(serverMsg instanceof AMQMessage)
        {
            AMQMessage message_0_8 = (AMQMessage) serverMsg;
            deliveryProps = new DeliveryProperties();
            messageProps = new MessageProperties();

            int size = (int) message_0_8.getSize();
            ByteBuffer body = ByteBuffer.allocate(size);
            message_0_8.getContent(body, 0);
            body.flip();

            BasicContentHeaderProperties properties =
                    (BasicContentHeaderProperties) message_0_8.getContentHeaderBody().getProperties();
            final AMQShortString exchange = message_0_8.getMessagePublishInfo().getExchange();
            if(exchange != null)
            {
                deliveryProps.setExchange(exchange.toString());
            }
            deliveryProps.setExpiration(message_0_8.getExpiration());
            deliveryProps.setImmediate(message_0_8.isImmediate());
            deliveryProps.setPriority(MessageDeliveryPriority.get(properties.getPriority()));
            deliveryProps.setRedelivered(entry.isRedelivered());
            deliveryProps.setRoutingKey(message_0_8.getRoutingKey());
            deliveryProps.setTimestamp(properties.getTimestamp());

            messageProps.setContentEncoding(properties.getEncodingAsString());
            messageProps.setContentLength(size);
            if(properties.getAppId() != null)
View Full Code Here

            trans.enqueue(currentMessage.getDestinationQueues(), currentMessage, new ServerTransaction.Action() {
                public void postCommit()
                {
                    try
                    {
                        AMQMessage message = new AMQMessage(currentMessage.getStoredMessage());

                        for(BaseQueue queue : destinationQueues)
                        {
                            queue.enqueue(message);
                        }
View Full Code Here

        SimpleQueueEntryList list = new SimpleQueueEntryList(_queue);

        // Add initial messages to QueueEntryList
        for (int count = 0; count < INITIAL_MSG_COUNT; count++)
        {
            AMQMessage msg = new MockAMQMessage(id);

            list.add(msg);

            //Increment ID;
            id++;
View Full Code Here

        final AMQShortString exchangeName;
        final AMQShortString routingKey;

        if(entry.getMessage() instanceof AMQMessage)
        {
            final AMQMessage message = (AMQMessage) entry.getMessage();
            final MessagePublishInfo pb = message.getMessagePublishInfo();
            exchangeName = pb.getExchange();
            routingKey = pb.getRoutingKey();
        }
        else
        {
            MessageTransferMessage message = (MessageTransferMessage) entry.getMessage();
            DeliveryProperties delvProps = message.getHeader().getDeliveryProperties();
            exchangeName = (delvProps == null || delvProps.getExchange() == null) ? null : new AMQShortString(delvProps.getExchange());
            routingKey = (delvProps == null || delvProps.getRoutingKey() == null) ? null : new AMQShortString(delvProps.getRoutingKey());
        }

        final boolean isRedelivered = entry.isRedelivered();
View Full Code Here

        final AMQShortString exchangeName;
        final AMQShortString routingKey;

        if(entry.getMessage() instanceof AMQMessage)
        {
            final AMQMessage message = (AMQMessage) entry.getMessage();
            final MessagePublishInfo pb = message.getMessagePublishInfo();
            exchangeName = pb.getExchange();
            routingKey = pb.getRoutingKey();
        }
        else
        {
            MessageTransferMessage message = (MessageTransferMessage) entry.getMessage();
            DeliveryProperties delvProps = message.getHeader().getDeliveryProperties();
            exchangeName = (delvProps == null || delvProps.getExchange() == null) ? null : new AMQShortString(delvProps.getExchange());
            routingKey = (delvProps == null || delvProps.getRoutingKey() == null) ? null : new AMQShortString(delvProps.getRoutingKey());
        }

        final boolean isRedelivered = entry.isRedelivered();
View Full Code Here

    {
        MessageMetaData mmd = message.headersReceived(System.currentTimeMillis());
        message.setStoredMessage(_store.addMessage(mmd));

        message.enqueue(_exchange.route(message));
        AMQMessage msg = new AMQMessage(message.getStoredMessage());
        for(BaseQueue q : message.getDestinationQueues())
        {
            q.enqueue(msg);
        }
        return message.getDestinationQueues().size();
View Full Code Here

            {

            }
        });

        AMQMessage m = new AMQMessage(msg.getStoredMessage());
        for(BaseQueue q : msg.getDestinationQueues())
        {
            q.enqueue(m);
        }
//        _queue.process(_storeContext, new QueueEntry(_queue, msg), false);
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.message.AMQMessage

Copyright © 2018 www.massapicom. 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.