Package org.apache.qpid.server.message

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



    @Override
    public MessageDestination getMessageDestination(final String name)
    {
        MessageDestination destination = _systemNodeDestinations.get(name);
        return destination == null ? getExchange(name) : destination;
    }
View Full Code Here


        AMQShortString exchangeName = body.getExchange();
        VirtualHostImpl vHost = session.getVirtualHost();

        // TODO: check the delivery tag field details - is it unique across the broker or per subscriber?

        MessageDestination destination;

        if (exchangeName == null || AMQShortString.EMPTY_STRING.equals(exchangeName))
        {
            destination = vHost.getDefaultDestination();
        }
View Full Code Here

            closeChannel(AMQConstant.MESSAGE_TOO_LARGE,
                         "Channel flow control was requested, but not enforced by sender");
        }
        else
        {
            MessageDestination destination;

            if (isDefaultExchange(exchangeName))
            {
                destination = vHost.getDefaultDestination();
            }
View Full Code Here


    @Override
    public MessageDestination getMessageDestination(final String name)
    {
        MessageDestination destination = _systemNodeDestinations.get(name);
        return destination == null ? getExchange(name) : destination;
    }
View Full Code Here

            exception(ssn, xfr, ExecutionErrorCode.RESOURCE_LIMIT_EXCEEDED,
                      "Message size of " + xfr.getBodySize() + " greater than allowed maximum of " + serverSession.getConnection().getMaxMessageSize());
        }
        else
        {
            final MessageDestination destination = getDestinationForMessage(ssn, xfr);

            final DeliveryProperties delvProps =
                    xfr.getHeader() == null ? null : xfr.getHeader().getDeliveryProperties();
            if (delvProps != null && delvProps.hasTtl() && !delvProps.hasExpiration())
            {
                delvProps.setExpiration(System.currentTimeMillis() + delvProps.getTtl());
            }

            final MessageMetaData_0_10 messageMetaData = new MessageMetaData_0_10(xfr);

            final VirtualHostImpl virtualHost = getVirtualHost(ssn);
            try
            {
                virtualHost.getSecurityManager()
                        .authorisePublish(messageMetaData.isImmediate(),
                                          messageMetaData.getRoutingKey(),
                                          destination.getName(),
                                          virtualHost.getName());
            }
            catch (AccessControlException e)
            {
                ExecutionErrorCode errorCode = ExecutionErrorCode.UNAUTHORIZED_ACCESS;
                exception(ssn, xfr, errorCode, e.getMessage());

                return;
            }

            final MessageStore store = virtualHost.getMessageStore();
            final StoredMessage<MessageMetaData_0_10> storeMessage = createStoreMessage(xfr, messageMetaData, store);
            final MessageTransferMessage message =
                    new MessageTransferMessage(storeMessage, serverSession.getReference());
            MessageReference<MessageTransferMessage> reference = message.newReference();

            final InstanceProperties instanceProperties = new InstanceProperties()
            {
                @Override
                public Object getProperty(final Property prop)
                {
                    switch (prop)
                    {
                        case EXPIRATION:
                            return message.getExpiration();
                        case IMMEDIATE:
                            return message.isImmediate();
                        case MANDATORY:
                            return (delvProps == null || !delvProps.getDiscardUnroutable())
                                   && xfr.getAcceptMode() == MessageAcceptMode.EXPLICIT;
                        case PERSISTENT:
                            return message.isPersistent();
                        case REDELIVERED:
                            return delvProps.getRedelivered();
                    }
                    return null;
                }
            };

            int enqueues = serverSession.enqueue(message, instanceProperties, destination);

            if (enqueues == 0)
            {
                if ((delvProps == null || !delvProps.getDiscardUnroutable())
                    && xfr.getAcceptMode() == MessageAcceptMode.EXPLICIT)
                {
                    RangeSet rejects = RangeSetFactory.createRangeSet();
                    rejects.add(xfr.getId());
                    MessageReject reject = new MessageReject(rejects, MessageRejectCode.UNROUTABLE, "Unroutable");
                    ssn.invoke(reject);
                }
                else
                {
                    virtualHost.getEventLogger().message(ExchangeMessages.DISCARDMSG(destination.getName(),
                                                                                     messageMetaData.getRoutingKey()));
                }
            }

            if (serverSession.isTransactional())
View Full Code Here

    private MessageDestination getDestinationForMessage(Session ssn, MessageTransfer xfr)
    {
        VirtualHostImpl virtualHost = getVirtualHost(ssn);

        MessageDestination destination;
        if(xfr.hasDestination())
        {
            destination = virtualHost.getMessageDestination(xfr.getDestination());
            if(destination == null)
            {
View Full Code Here

                                destination = null;
                            }
                        }
                        else
                        {
                            MessageDestination messageDestination = getVirtualHost().getMessageDestination(addr);
                            if(messageDestination != null)
                            {
                                destination = new NodeReceivingDestination(messageDestination, target.getDurable(),
                                                                           target.getExpiryPolicy());
                            }
View Full Code Here

    {
        AMQShortString routingKey = new AMQShortString(queueName);
        AMQShortString exchangeNameAsShortString = new AMQShortString(exchangeName);
        MessagePublishInfo info = new MessagePublishInfo(exchangeNameAsShortString, false, false, routingKey);

        MessageDestination destination;
        if(exchangeName == null || "".equals(exchangeName))
        {
            destination = channel.getVirtualHost().getDefaultDestination();
        }
        else
View Full Code Here

TOP

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

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.