Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQAnyDestination


        }
    }
   
    public void testQueueReceiversAndTopicSubscriber() throws Exception
    {
        Queue queue = new AMQAnyDestination("ADDR:my-queue; {create: always}");
        Topic topic = new AMQAnyDestination("ADDR:amq.topic/test");
       
        QueueSession qSession = ((AMQConnection)_connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        QueueReceiver receiver = qSession.createReceiver(queue);
       
        TopicSession tSession = ((AMQConnection)_connection).createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here


        MessageConsumer cons;
       
        // default (create never, assert never) -------------------
        // create never --------------------------------------------
        String addr1 = "ADDR:testQueue1;{create: always, delete: always}";
        AMQDestination  dest = new AMQAnyDestination(addr1);
        try
        {
            cons = jmsSession.createConsumer(dest);
            cons.close();
        }
        catch(JMSException e)
        {
            fail("Exception should not be thrown. Exception thrown is : " + e);
        }
       
        assertFalse("Queue not deleted as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true))
       
       
        String addr2 = "ADDR:testQueue2;{create: always, delete: receiver}";
        dest = new AMQAnyDestination(addr2);
        try
        {
            cons = jmsSession.createConsumer(dest);
            cons.close();
        }
        catch(JMSException e)
        {
            fail("Exception should not be thrown. Exception thrown is : " + e);
        }
       
        assertFalse("Queue not deleted as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true))

       
        String addr3 = "ADDR:testQueue3;{create: always, delete: sender}";
        dest = new AMQAnyDestination(addr3);
        try
        {
            cons = jmsSession.createConsumer(dest);
            MessageProducer prod = jmsSession.createProducer(dest);
            prod.close();
        }
        catch(JMSException e)
        {
            fail("Exception should not be thrown. Exception thrown is : " + e);
        }
       
        assertFalse("Queue not deleted as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true))

       
    }
View Full Code Here

        acceptModeTest("ADDR:testQueue1;{create: always}",2);
              
        String addr3 = "ADDR:testQueue2;{create: always, delete : receiver, link : {reliability : exactly-once}}";       
        try
        {
            AMQAnyDestination dest = new AMQAnyDestination(addr3);
            fail("An exception should be thrown indicating it's an unsupported type");
        }
        catch(Exception e)
        {
            assertTrue(e.getCause().getMessage().contains("The reliability mode 'exactly-once' is not yet supported"));
        }
       
        String addr4 = "ADDR:amq.topic/test;{link : {reliability : at-least-once}}";       
        try
        {
            AMQAnyDestination dest = new AMQAnyDestination(addr4);
            Session ssn = _connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
            MessageConsumer cons = ssn.createConsumer(dest);
            fail("An exception should be thrown indicating it's an unsupported combination");
        }
        catch(Exception e)
View Full Code Here

    {
        Session ssn = _connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
        MessageConsumer cons;
        MessageProducer prod;
       
        AMQDestination  dest = new AMQAnyDestination(address);
        cons = ssn.createConsumer(dest);
        prod = ssn.createProducer(dest);
       
        for (int i=0; i < expectedQueueDepth; i++)
        {
View Full Code Here

    {
        if (_ssn == null)
        {
            _ssn = _conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
            MessageConsumer cons = _ssn.createConsumer(
                                        new AMQAnyDestination(new AMQShortString("amq.failover"),
                                                              new AMQShortString("amq.failover"),
                                                              new AMQShortString(""),
                                                              true,true,null,false,
                                                              new AMQShortString[0]));
            cons.setMessageListener(this);
View Full Code Here

        super(args, usage, desc);       
       
        Connection con = createConnection();
        con.start();
        Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE);    
        Destination dest = new AMQAnyDestination(address);
        MessageConsumer consumer = ssn.createConsumer(dest);
        Message msg;
       
        long timeout = -1;       
        int count = 0;
View Full Code Here

        super(args, usage, desc);       
       
        Connection con = createConnection();
        con.start();
        Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE);    
        Destination dest = new AMQAnyDestination(address);
        MessageProducer producer = ssn.createProducer(dest);
       
        int count = Integer.parseInt(getOp(COUNT));
       
        for (int i=0; i < count; i++)
View Full Code Here

       this.msg_size = Integer.getInteger("msg_size", 100);
       this.msg_count = Integer.getInteger("msg_count", 10);
       this.iterations = Integer.getInteger("iterations", -1);
       this.sleep_time = Long.getLong("sleep_time", 1000);
       this.setSsn(con.createSession(isTransacted(),Session.AUTO_ACKNOWLEDGE));
       this.dest = new AMQAnyDestination(addr);
       this.producer = getSsn().createProducer(dest);
       this.replyTo = getSsn().createTemporaryQueue();
      
       System.out.println("Sending messages to : " + addr);
    }
View Full Code Here

        try
        {
            controlCon = new AMQConnection(url);
            controlCon.start();
           
            controlDest = new AMQAnyDestination("control; {create: always}"); // durable

            // Create the session to setup the messages
            controlSession = controlCon.createSession(false, Session.AUTO_ACKNOWLEDGE);
            statusSender = controlSession.createProducer(controlDest);
View Full Code Here

   
    public Receiver(Connection con,String addr) throws Exception
    {
      super(con);
      setSsn(con.createSession(isTransacted(), getAck_mode()));
      consumer = getSsn().createConsumer(new AMQAnyDestination(addr));
      if (!syncRcv)
      {
        consumer.setMessageListener(this);
      }
     
View Full Code Here

TOP

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

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.