Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQQueue


    public void testJMSProperties() throws Exception
    {
        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
        AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
        Queue queue =
            new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("someQ"), new AMQShortString("someQ"), false,
                true);
        MessageConsumer consumer = consumerSession.createConsumer(queue);

        AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
        Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
        MessageProducer producer = producerSession.createProducer(queue);
        Destination JMS_REPLY_TO = new AMQQueue(con2, "my.replyto");
        // create a test message to send
        ObjectMessage sentMsg = new NonQpidObjectMessage(producerSession);
        sentMsg.setJMSCorrelationID(JMS_CORR_ID);
        sentMsg.setJMSDeliveryMode(JMS_DELIV_MODE);
        sentMsg.setJMSType(JMS_TYPE);
View Full Code Here


     * Uses getTestQueueName() as the name of the queue
     * @return
     */
    public Queue getTestQueue()
    {
        return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, getTestQueueName());
    }
View Full Code Here

    public void testPriority() throws JMSException, NamingException, AMQException
    {
        final Map<String,Object> arguments = new HashMap<String, Object>();
        arguments.put("x-qpid-priorities",10);
        ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
        queue = new AMQQueue("amq.direct",QUEUE);
        ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
        producer = producerSession.createProducer(queue);

        for (int msg = 0; msg < MSG_COUNT; msg++)
        {
View Full Code Here

    public void testOddOrdering() throws AMQException, JMSException
    {
        final Map<String,Object> arguments = new HashMap<String, Object>();
        arguments.put("x-qpid-priorities",3);
        ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
        queue = new AMQQueue("amq.direct",QUEUE);
        ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
        producer = producerSession.createProducer(queue);
       
        // In order ABC
        producer.setPriority(9);
View Full Code Here

        AMQDestination dest;

        switch(type.intValue())
        {
            case AMQDestination.QUEUE_TYPE:
                dest = new AMQQueue(exchange, routingKey, routingKey);
                break;
            case  AMQDestination.TOPIC_TYPE:
                dest = new AMQTopic(exchange, routingKey, null);
                break;
            default:
View Full Code Here

            AMQConnection[] cons = new AMQConnection[connection_count];
            Session[] sessions = new Session[connection_count];
            MessageConsumer[] msgCons = new MessageConsumer[connection_count];
            MessageProducer [] msgProds = new MessageProducer[connection_count];
            Destination dest = new AMQQueue(new AMQShortString(exchange_name),
                                            new AMQShortString(routing_key),
                                            new AMQShortString(queue_name),
                                            true, //exclusive
                                            true  // auto delete
                                            );
View Full Code Here

        //Create Connection
        _connection = getConnection();

        //Create Queue
        Queue queue = new AMQQueue("amq.direct", "queue");

        //Create Session
        _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        //Create Consumer
View Full Code Here

                    {
                        try
                        {
                            MessageProducer prod = session.createProducer(dest);
                            // this will ensure that the producer will not overun the consumer.
                            feedbackQueue = new AMQQueue(new AMQShortString("amq.direct"), new AMQShortString(UUID
                                    .randomUUID().toString()), new AMQShortString("control"));

                            MessageConsumer feedbackConsumer = session.createConsumer(feedbackQueue);

                            while (true)
View Full Code Here

                sessions[i] = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
                prods[i] = sessions[i].createProducer(dest);
            }

            // this will ensure that the producer will not overun the consumer.
            feedbackQueue = new AMQQueue(new AMQShortString("amq.direct"),
                                         new AMQShortString(UUID.randomUUID().toString()),
                                         new AMQShortString("control"));

            MessageConsumer feedbackConsumer = sessions[0].createConsumer(feedbackQueue);
View Full Code Here

    }

    @Override
    public Queue createQueue(String name) throws AMQException {
        QpidUtil.createQueue(virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, name);
        return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, name);
    }
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.