Package org.apache.qpid.client

Examples of org.apache.qpid.client.AMQDestination


            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertFalse(dest.isExchangeAutoDelete());
        assertFalse(dest.isExchangeDurable());
        assertFalse(dest.isExchangeInternal());
    }
View Full Code Here


            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertTrue(dest.isExchangeAutoDelete());
        assertFalse(dest.isExchangeDurable());
        assertFalse(dest.isExchangeInternal());
    }
View Full Code Here

            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertTrue(dest.isExchangeDurable());
        assertFalse(dest.isExchangeAutoDelete());
        assertFalse(dest.isExchangeInternal());
    }
View Full Code Here

            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertTrue(dest.isExchangeInternal());
        assertFalse(dest.isExchangeDurable());
        assertFalse(dest.isExchangeAutoDelete());
    }
View Full Code Here

            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertEquals("Reject behaviour is unexpected", RejectBehaviour.SERVER, dest.getRejectBehaviour());
    }
View Full Code Here

            {
                return false;
            }
        };

        AMQDestination dest = new MyTestAMQDestination(burl);
        assertNull("Reject behaviour is unexpected", dest.getRejectBehaviour());
    }
View Full Code Here

        _messageProps = messageProps;
        _deliveryProps = deliveryProps;
        _deliveryTag = deliveryTag;
        _readableProperties = (_messageProps != null);

        AMQDestination dest;

        dest = generateDestination(new AMQShortString(_deliveryProps.getExchange()),
                                   new AMQShortString(_deliveryProps.getRoutingKey()));
        setJMSDestination(dest);       
    }
View Full Code Here

        {
            throw new IllegalArgumentException(
                "ReplyTo destination may only be an AMQDestination - passed argument was type " + destination.getClass());
        }

        final AMQDestination amqd = (AMQDestination) destination;

        if (amqd.getDestSyntax() == AMQDestination.DestSyntax.ADDR)
        {
           try
           {
               int type = ((AMQSession_0_10)_session).resolveAddressType(amqd);
               if (type == AMQDestination.QUEUE_TYPE)
               {
                   ((AMQSession_0_10)_session).setLegacyFiledsForQueueType(amqd);
               }
               else
               {
                   ((AMQSession_0_10)_session).setLegacyFiledsForTopicType(amqd);
               }
           }
           catch(AMQException ex)
           {
               JMSException e = new JMSException("Error occured while figuring out the node type");
               e.initCause(ex);
               e.setLinkedException(ex);
               throw e;
           }
        }
       
        final ReplyTo replyTo = new ReplyTo(amqd.getExchangeName().toString(), amqd.getRoutingKey().toString());
        _destinationCache.put(replyTo, new SoftReference<Destination>(destination));
        _messageProps.setReplyTo(replyTo);

    }
View Full Code Here

        MessageConsumer cons;
       
        // default (create never, assert never) -------------------
        // create never --------------------------------------------
        String addr1 = "ADDR:testQueue1";
        AMQDestination  dest = new AMQAnyDestination(addr1);
        try
        {
            cons = jmsSession.createConsumer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getMessage().contains("The name 'testQueue1' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
       
        try
        {
            prod = jmsSession.createProducer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getCause().getCause().getMessage().contains("The name 'testQueue1' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
           
        assertFalse("Queue should not be created",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest, (QueueNode)dest.getSourceNode() ,true));
       
       
        // create always -------------------------------------------
        addr1 = "ADDR:testQueue1; { create: always }";
        dest = new AMQAnyDestination(addr1);
        cons = jmsSession.createConsumer(dest);
       
        assertTrue("Queue not created as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));             
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("",
                    dest.getAddressName(),dest.getAddressName(), dest.getSourceNode().getDeclareArgs()));
       
        // create receiver -----------------------------------------
        addr1 = "ADDR:testQueue2; { create: receiver }";
        dest = new AMQAnyDestination(addr1);
        try
        {
            prod = jmsSession.createProducer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getCause().getCause().getMessage().contains("The name 'testQueue2' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
           
        assertFalse("Queue should not be created",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));
       
       
        cons = jmsSession.createConsumer(dest);
       
        assertTrue("Queue not created as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));             
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("",
                    dest.getAddressName(),dest.getAddressName(), dest.getSourceNode().getDeclareArgs()));
       
        // create never --------------------------------------------
        addr1 = "ADDR:testQueue3; { create: never }";
        dest = new AMQAnyDestination(addr1);
        try
        {
            cons = jmsSession.createConsumer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getMessage().contains("The name 'testQueue3' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
       
        try
        {
            prod = jmsSession.createProducer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getCause().getCause().getMessage().contains("The name 'testQueue3' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
           
        assertFalse("Queue should not be created",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));
       
        // create sender ------------------------------------------
        addr1 = "ADDR:testQueue3; { create: sender }";
        dest = new AMQAnyDestination(addr1);
               
        try
        {
            cons = jmsSession.createConsumer(dest);
        }
        catch(JMSException e)
        {
            assertTrue(e.getMessage().contains("The name 'testQueue3' supplied in the address " +
                    "doesn't resolve to an exchange or a queue"));
        }
        assertFalse("Queue should not be created",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));
       
        prod = jmsSession.createProducer(dest);
        assertTrue("Queue not created as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));             
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("",
                    dest.getAddressName(),dest.getAddressName(), dest.getSourceNode().getDeclareArgs()));
       
    }
View Full Code Here

                                               "{exchange : 'amq.topic', key : 'a.#'}" +
                                              "]," +
                                    
                            "}" +
                      "}";
        AMQDestination dest = new AMQAnyDestination(addr);
        MessageConsumer cons = jmsSession.createConsumer(dest);
       
        assertTrue("Queue not created as expected",(
                (AMQSession_0_10)jmsSession).isQueueExist(dest,(QueueNode)dest.getSourceNode(), true));             
       
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("",
                    dest.getAddressName(),dest.getAddressName(), null));
       
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("amq.direct",
                    dest.getAddressName(),"test", null));
       
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("amq.fanout",
                    dest.getAddressName(),null, null));
       
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("amq.topic",
                    dest.getAddressName(),"a.#", null));  
       
        Map<String,Object> args = new HashMap<String,Object>();
        args.put("x-match","any");
        args.put("dep","sales");
        args.put("loc","CA");
        assertTrue("Queue not bound as expected",(
                (AMQSession_0_10)jmsSession).isQueueBound("amq.match",
                    dest.getAddressName(),null, args));
       
    }
View Full Code Here

TOP

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

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.