Hi all, I need to understand if it is possible to create new 
ClientConsumer/MessageConsumer, each with their associated 
MessageHandler/MessageListener, after i already created consumers in the same 
way and they started receiving data. Basically i have a topic which will 
receive data updates for a large number of items with an id identifying them. 
My application will be composed of multiple instances, each one subscribing to 
updates on a different set of items (using filters) and that set is not fixed 
nor is predictable when a new item will need to be subscribed: could be at 
startup or hours later. So at any time i could need to call createConsumer in a 
session, particularly when async listeners have already started receiving 
messages on onMessage. Creating new sessions is problematic, as the number of 
items subscribed on each instance could be on the hundreds. Regarding that, 
core ClientConsumer setMessageHandler states that: Note that setting a handler 
dedicates the parent session, and its child producers and consumers, to the 
session-wide handler delivery thread of control. Would this thread being the 
one on which onMessage is called? In that case even if is not that clean, i 
could process creating new consumers inside of that callback? Or i am forced to 
synchronize the onMessage with the separate part where i create the new 
consumer? I tried to understand from JMS only documentation and discussions if 
there is a way to do this, but multi threading limitations on session seems not 
giving me a lot of options . Thanks, Gianluca Milza

Reply via email to