Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.Exchange


                final TransactionLogResource owningResource = rejectedQueueEntry.getOwningResource();
                if(owningResource instanceof AMQQueue)
                {
                    final AMQQueue queue = (AMQQueue) owningResource;

                    final Exchange altExchange = queue.getAlternateExchange();

                    if (altExchange == null)
                    {
                        _logger.debug("No alternate exchange configured for queue, must discard the message as unable to DLQ: delivery tag: " + deliveryTag);
                        getVirtualHost().getEventLogger().message(_logSubject,
                                                                  ChannelMessages.DISCARDMSG_NOALTEXCH(msg.getMessageNumber(),
                                                                                                       queue.getName(),
                                                                                                       msg.getInitialRoutingAddress()));

                    }
                    else
                    {
                        _logger.debug(
                                "Routing process provided no queues to enqueue the message on, must discard message as unable to DLQ: delivery tag: "
                                + deliveryTag);
                        getVirtualHost().getEventLogger().message(_logSubject,
                                                                  ChannelMessages.DISCARDMSG_NOROUTE(msg.getMessageNumber(),
                                                                                                     altExchange.getName()));
                    }
                }
            }

        }
View Full Code Here


        }

        List<? extends BaseQueue> queues = route(message, routingAddress, instanceProperties);
        if(queues == null || queues.isEmpty())
        {
            Exchange altExchange = getAlternateExchange();
            if(altExchange != null)
            {
                return altExchange.send(message, routingAddress, instanceProperties, txn, postEnqueueAction);
            }
            else
            {
                return 0;
            }
View Full Code Here

                                                                    exchangeType));
    }

    public void testUnregisterExchange() throws Exception
    {
        Exchange mockExchange = mock(Exchange.class);
        when(mockExchange.getName()).thenReturn(EXCHANGE_1_NAME);
        when(_mockVirtualHost.getExchanges()).thenReturn(Collections.singletonList(mockExchange));
        when(_mockVirtualHost.getChildByName(eq(Exchange.class), eq(EXCHANGE_1_NAME))).thenReturn(mockExchange);


        _virtualHostManagerMBean.unregisterExchange(EXCHANGE_1_NAME);
View Full Code Here

        verify(mockExchange).deleteWithChecks();
    }

    public void testUnregisterExchangeWhenExchangeDoesNotExist() throws Exception
    {
        Exchange mockExchange = mock(Exchange.class);
        when(mockExchange.getName()).thenReturn(EXCHANGE_1_NAME);
        when(_mockVirtualHost.getExchanges()).thenReturn(Collections.singletonList(mockExchange));
        when(_mockVirtualHost.getChildByName(eq(Exchange.class), eq(EXCHANGE_1_NAME))).thenReturn(mockExchange);

        try
        {
View Full Code Here

        {
            TransactionLogResource owningResource = entry.getOwningResource();
            if(owningResource instanceof AMQQueue)
            {
                final AMQQueue queue = (AMQQueue)owningResource;
                final Exchange alternateExchange = queue.getAlternateExchange();

                if(alternateExchange != null)
                {
                    getEventLogger().message(ChannelMessages.DISCARDMSG_NOROUTE(msg.getMessageNumber(),
                                                                           alternateExchange.getName()));
                }
                else
                {
                    getEventLogger().message(ChannelMessages.DISCARDMSG_NOALTEXCH(msg.getMessageNumber(),
                                                                             queue.getName(),
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.Exchange

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.