Examples of AMQQueue


Examples of org.apache.qpid.client.AMQQueue

        _session = (AMQSession<?, ?>) _connection.createSession(true, Session.SESSION_TRANSACTED);
    }

    public void testQueueCannotBeReboundOnNonTopicExchange() throws Exception
    {
        runTestForNonTopicExhange(new AMQQueue(new AMQBindingURL("direct://amq.direct//" + getTestQueueName())));
        runTestForNonTopicExhange(new AMQQueue(new AMQBindingURL("fanout://amq.fanout//" + getTestQueueName()) + "?routingkey='"
                + getTestQueueName() + "'"));
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

                + getTestQueueName() + "'"));
    }

    public void testQueueCanBeReboundOnTopicExchange() throws Exception
    {
        AMQQueue destination = new AMQQueue(new AMQBindingURL("topic://amq.topic//" + getTestQueueName() + "?routingkey='"
                + getTestQueueName() + "'"));
        setTestClientSystemProperty("qpid.default_mandatory", "false");
        runTestForTopicExchange(destination);

    }
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

        {
            dest = new AMQTopic(exchange, routingKey, null);
        }
        else if ("direct".equals(exchangeInfo.getExchangeType()))
        {
            dest = new AMQQueue(exchange, routingKey, routingKey);
        }
        else
        {
            dest = new AMQAnyDestination(exchange,
                                         new AMQShortString(exchangeInfo.getExchangeType()),
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

    {
        AtomicInteger sentMessages = new AtomicInteger(0);
        AtomicInteger sentMessages2 = new AtomicInteger(0);

        _queue = getTestQueue();
        AMQQueue queue2 = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, getTestQueueName() + "_2");

        ((AMQSession<?,?>) _producerSession).declareAndBind((AMQDestination)_queue);
        ((AMQSession<?,?>) _producerSession).declareAndBind((AMQDestination)queue2);

        _producer = _producerSession.createProducer(_queue);
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

    private Queue createQueue() throws AMQException, JMSException
    {
        final Map<String, Object> arguments = new HashMap<String, Object>();
        arguments.put(QueueArgumentsConverter.QPID_QUEUE_SORT_KEY, TEST_SORT_KEY);
        ((AMQSession<?,?>) _producerSession).createQueue(new AMQShortString(getTestQueueName()), false, true, false, arguments);
        final Queue queue = new AMQQueue("amq.direct", getTestQueueName());
        ((AMQSession<?,?>) _producerSession).declareAndBind((AMQDestination) queue);
        return queue;
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

        final String topicName = getName();
        final String clientId = "clientId" + topicName;
        final Connection con1 = getConnection();
        final Session session1 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
        final Topic topic1 = session1.createTopic(topicName);
        final AMQQueue internalNameOnBroker = new AMQQueue("amq.topic", "clientid" + ":" + clientId);

        // Setup subscriber with selector
        final TopicSubscriber subscriberWithSelector = session1.createDurableSubscriber(topic1, clientId, "Selector = 'select'", false);
        final MessageProducer publisher = session1.createProducer(topic1);
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

        final CountDownLatch awaitMessages = new CountDownLatch(1);
        final AtomicReference<Throwable> listenerCaughtException = new AtomicReference<Throwable>();

        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
        AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
        AMQQueue queue = new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("testQ"));
        MessageConsumer consumer = consumerSession.createConsumer(queue);
        consumer.setMessageListener(new MessageListener()
            {

                public void onMessage(Message message)
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

        _bouncedMessageList.clear();
        Connection con = getConnection();

        AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);

        AMQQueue valid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE");
        AMQQueue invalid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE_INVALID");
        MessageConsumer consumer = consumerSession.createConsumer(valid_queue);

        //force synch to ensure the consumer has resulted in a bound queue
        //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
        // This is the default now
View Full Code Here

Examples of org.apache.qpid.client.AMQQueue

     */
    protected Queue createQueue(Object value)
    {
        if (value instanceof AMQShortString)
        {
            return new AMQQueue(AMQShortString.valueOf(ExchangeDefaults.DIRECT_EXCHANGE_NAME), (AMQShortString) value);
        }
        else if (value instanceof String)
        {
            return new AMQQueue(AMQShortString.valueOf(ExchangeDefaults.DIRECT_EXCHANGE_NAME), new AMQShortString((String) value));
        }
        else if (value instanceof BindingURL)
        {
            return new AMQQueue((BindingURL) value);
        }

        return null;
    }
View Full Code Here

Examples of org.apache.qpid.server.queue.AMQQueue

        assertEquals("Incorrect number of queues registered after first recovery",
                1,  getVirtualHost().getQueues().size());

        //test that removing the queue means it is not recovered next time
        final AMQQueue queue = getVirtualHost().getQueue(durableQueueName);
        DurableConfigurationStoreHelper.removeQueue(getVirtualHost().getDurableConfigurationStore(),queue);

        reloadVirtualHost();

        assertEquals("Incorrect number of queues registered after second recovery",
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.