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.

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]

Reply via email to