Package org.apache.qpid.client

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


                + 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

        {
            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

    {
        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

    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

        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

        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

        _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

     */
    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

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

    public void testDeclareAndBindWhenQueueIsNotSpecifiedInDestinationUrl() throws Exception
    {
        AMQQueue destination = new AMQQueue(new AMQBindingURL("topic://amq.topic//?routingkey='testTopic'"));

        assertEquals("Queue name is generated in parser", AMQShortString.EMPTY_STRING, destination.getAMQQueueName());

        _session.declareAndBind(destination, FieldTable.convertToFieldTable(Collections.<String, Object> emptyMap()));

        assertFalse("Unexpected queue name: [" + destination.getAMQQueueName() + "]", AMQShortString.EMPTY_STRING.equals(destination.getAMQQueueName()));

        sendMessage(_session, destination, 1);

        MessageConsumer consumer = _session.createConsumer(destination);
        _connection.start();
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.AMQQueue

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.