Hallo,

I hope this is the right place to ask about qpid jms.
I use qpid jms client 0.41.0 with qpidd broker 1.38.

I'm creating created a fanout exchange (qpid-config add exchange fan ABC)
and subscribe to it from java client using Topic and a MessageConsumer.
On server side a queue is created for each client with name like
"ID:84f6157f-8da4-42b4-a62a-dcc789f05806:1_qpid-jms:receiver:ID:71243772-61c8-4efc-9e85-eaca07de97e2:1:1:1:ABC"
which is not temporary (no autDel flag set).

If client crashes this queue remains on server side and is still filled
with messages.

How can we make the queue on server side temporary and deleted as soon as
client terminates?

Here's the code I use to read data from fanout:

   String url   = "amqp://10.194.4.10:5672";
   String topicName = "FAN_BAEDS";

   Properties properties = new Properties();
   properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, 
"org.apache.qpid.jms.jndi.JmsInitialContextFactory");
   properties.setProperty("connectionfactory.myFactoryLookup",  url);
   properties.setProperty("topic.myTopicLookup",  topicName);

   // The configuration for the Qpid InitialContextFactory has been supplied in
   // a jndi.properties file in the classpath, which results in it being picked
   // up automatically by the InitialContext constructor.
   Context context = new InitialContext(properties);

   ConnectionFactory factory = (ConnectionFactory) 
context.lookup("myFactoryLookup");
   Destination topic = (Destination)context.lookup("myTopicLookup");

   Connection connection = factory.createConnection(System.getProperty("USER"), 
System.getProperty("PASSWORD"));
   connection.setExceptionListener(new MyExceptionListener());
   connection.start();
   Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

   MessageConsumer consumer = session.createConsumer(topic);

   Thread.sleep(10000);

   consumer.close();
   session.close();

Best regards,
-- 
 \   / |                                   |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |                                   |
  \^/  |      E-mail:  iv...@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to