On Thu, Dec 22, 2011 at 4:10 AM, eugene <[email protected]> wrote:
> Aha - thx for the link. So a subject is really a routing key, right? That is
> why I missed it, cause I was looking for a routing key and not subject.
Eugene, sorry for the late reply.
The subject is mapped to the routing key when using AMQP 0-10
The addressing syntax is aimed at being protocol or version agnostic.
Please read the documentation in full to understand the address
concepts and how it maps onto the 0-10 version of the AMQP protocol.
The name specified in the link property is for the subscription queue
and the subscription queue is only created for a consumer.
In your code there is no subscriber, hence the subscription queue
never gets created.
If you add a subscriber (in your example) before the producer you will
see the queue being created, the message being put into the queue and
received by the subscriber.
Regards,
Rajith
> Here is the config file:
>
> java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid/test?brokerlist='tcp://172.16.113.130:5672'
> destination.tempQueue = TopicExchange/usa.#; {link : {name : my-queue} }
>
>
> And here is the Java File:
>
> public class CreateQueue {
> public static void main(String[] args) {
> new CreateQueue().runTest();
> }
>
> private void runTest() {
> try {
> Properties properties = new Properties();
>
> properties.load(this.getClass().getResourceAsStream("/tempqueue-cuminless/file.properties"));
> Context context = new InitialContext(properties);
>
> ConnectionFactory connectionFactory = (ConnectionFactory)
> context.lookup("qpidConnectionfactory");
> Connection connection = connectionFactory.createConnection();
> connection.start();
>
> Session
> session=connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
> Destination destination = (Destination)
> context.lookup("tempQueue");
>
> MessageProducer messageProducer =
> session.createProducer(destination);
>
> TextMessage message = session.createTextMessage("Hello world!");
> message.setStringProperty("qpid.subject", "usa.news");
>
> messageProducer.send(message);
>
>
> connection.close();
> context.close();
> }
> catch (Exception exp) {
> exp.printStackTrace();
> }
> }
> }
>
>
> From what I understood there should be a queue created with the name
> "my-queue", but it is not created. No Exception. on the CLient side, the
> /var/log/messages is very clean, no error, no nothing. But the queue is not
> created.
>
> Cheers,
> Eugene.
>
>
>
> --
> View this message in context:
> http://apache-qpid-developers.2158895.n2.nabble.com/AMQP-Java-JMS-Topic-Exchange-tp7112690p7117980.html
> Sent from the Apache Qpid developers mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project: http://qpid.apache.org
> Use/Interact: mailto:[email protected]
>
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]