So, finally I did it as desribed in my first posting.
Thanks for your help.
Hello Michael,
thank you for sharing your solution!
So you are using a temporary queue created by the client, persist it one server and use it to send messages to the client.
Two questions come into my mind:
* How do you persist the temporary queues - as serialized objects, into an OODB or as BLOBS into a relational DB?
* How do you check that the clients sessions/connection that has created the temporary queue is still alive?
With best regards,
Andreas
hopefully not too late...
* How do you persist the temporary queues - as serialized objects, into an OODB or as BLOBS into a relational DB?
// Serverside: persisting the queue
Message message = ...;
HornetQTemporaryQueue q = (HornetQTemporaryQueue) message.getJMSReplyTo();
String persistedQueue = q.getAddress(); // something like: jms.tempqueue-93478934789-c435f-234f-7sfh-2348sdfsh3478
persist(user, persistedQueue); // pseudo code
// Serverside: loading the queue
Session session = ...;
String persistedQueue = getPersistedQueue(user); // pseudo code
MessageProducer producer = session.createProducer(HornetQTemporaryQueue.fromAddress(persistedQueue));
producer.send(...);
For a more detailed post see my initial thread post.
* How do you check that the clients sessions/connection that has created the temporary queue is still alive?
Fortunately HornetQ is able to tell you this. You can specify a special notification topic (http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/management.html#management.notifications) where you receive events like:
_HQ_NotifyType=CONSUMER_CREATED
_HQ_NotifyType=CONSUMER_CLOSED