-
1. Re: MDB consumer not consuming messages in the queue after startup.
jbertram Aug 27, 2015 4:06 PM (in response to skionsnow)The first thing I would do is collect a few thread dumps when the it appears the MDB isn't consuming messages to see if something might be stuck somewhere.
-
2. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 4, 2015 7:02 AM (in response to jbertram)Justin,
I have not reproduced the startup issue yet to compare that jstack, but I left the server up over night and in the morning it was in the same non-consuming state. I have attached the jstack and a sample my of how I am producing messages and consuming messages on the one queue I know for sure was stuck(the first one that gets events). I don't see any blocked threads. I do however see far fewer Hornetq threads then when things are operating as expected. SynergyEventQueue is a singleton ejb that instantiates a SynergyQueueProducer to place the messages on the queue. SynergyMDB is the listener MDB.
Thanks,
Jim
-
jstackqueuenotconsuming.txt.zip 13.6 KB
-
SynergyMDB.java 3.1 KB
-
SynergyEventQueue.java 1.3 KB
-
SynergyQueueProducer.java 2.1 KB
-
domain.xml.zip 8.9 KB
-
QueueFactory.java 1.2 KB
-
-
3. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 4, 2015 7:05 AM (in response to skionsnow)One other thing. I have a number of other queues. They all follow the same basic pattern. A singleton ejb instantiating a queueProducer and an MDB listener.
-
4. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 4, 2015 7:14 AM (in response to skionsnow)Justin,
I just noticed that I forgot to designate SynergyEventQueue as a singleton. That would explain things.
Sorry,
Jim
-
5. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 4, 2015 7:36 AM (in response to skionsnow)Actually, I my last comment doesn't make sense. I see the messages being queued in my logs. So I still don't understand why the MDB didn't see it.
-
6. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 4, 2015 9:25 AM (in response to skionsnow)Justin,
One more piece of data. If I create a session for every message, I never see this issue. Is there some timeout for a Session, or MessageProducer that has no messages. The queues were not getting events for long periods of time.
Jim
-
7. Re: MDB consumer not consuming messages in the queue after startup.
jbertram Sep 5, 2015 10:25 PM (in response to skionsnow)If you're producing messages from within the application server (which it appears that you are) then you should be using a pooled-connection-factory rather than caching your connection. When you use a pooled-connection-factory you create the connection, session, producer, etc. every time you send the message because you know behind the scenes the pooled-connection-factory is managing the resources for you. Once you update your code to use this recommended pattern let me know if you still see the problem.
-
8. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 6, 2015 6:44 AM (in response to jbertram)Okay thanks will do that. Couple of questions: So I should not cache the queue-JNDI lookup as well? I am using this in a domain cluster how do I configure the pooled-connection for that?
-
9. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 6, 2015 10:13 PM (in response to skionsnow)FYI: I figured out that no caching is required. Thanks for the pointers.
-
10. Re: MDB consumer not consuming messages in the queue after startup.
jbertram Sep 7, 2015 10:43 AM (in response to skionsnow)I'd need more details on your server/domain setup to comment on how that might impact the pooled-connection-factory configuration.
-
11. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 8, 2015 11:08 AM (in response to skionsnow)Justin,
Not sure what you are asking. I am running in JBOSS EAP6.3. I have an HA-singleton service that runs on a single selected node in a configuration that for now has only two nodes. It receives events from another application via an SDK interface. It produces messages and places the messages on a queue. I would like for messages that my application receives from the singleton-service and placed on a JMS queue to be available to message consumers on both nodes. The jgroups configuration is set up so that it uses TCP transportation.
Thanks,
Jim
-
12. Re: MDB consumer not consuming messages in the queue after startup.
jbertram Sep 8, 2015 5:59 PM (in response to skionsnow)Messages put on any queue of any node of a symmetric cluster will be available to any consumer connected to any node of that cluster. Therefore you can just use the default pooled-connection-factory to send your messages to local queues.
-
13. Re: MDB consumer not consuming messages in the queue after startup.
skionsnow Sep 13, 2015 3:26 PM (in response to jbertram)Justin,
Thanks for all the help. Things seem to be working really well now. I have a question about the message group feature message.setStringProperty("JMSXGroupID", event.getConfId()); I noticed that if the queue empties subsequent messages with the same group id may be processed on the other node. This has presented no issues for my implementation, but I wanted to make sure that the grouping is expected to only persist if the queue has multiple messages associated with the group to verify that it is working as expected.
Thanks,
Jim