-
15. Re: producers blocked
clebert.suconic Aug 13, 2010 4:07 PM (in response to noky)Do you think you could provide a testcase for this?
-
16. Re: producers blocked
noky Aug 16, 2010 11:59 AM (in response to clebert.suconic)Unfortunately, I don't have a way to reproduce this problem. I eventually just configured the system to PAGE instead of BLOCK and this solved things (at least for now). Now I need to find a way to monitor the hornetq servers to make sure they are not paging excessively...
-
17. Re: producers blocked
manu29585 Jan 30, 2017 11:46 AM (in response to noky)Hello All,
Sorry for picking up an older post.
But. we have a bad situation in our production system.
We are using 2.1.2.Final version of Hornetq in JBoss 6.1.0 final.
Currently, we are reusing the connection and session and are created as shown below:
cachedQueueConnection = cachedConnectionFactory.createConnection();
// KEY - register for exception callbacks
cachedQueueConnection.setExceptionListener(new ExceptionJMSListenerImpl());
session = cachedQueueConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(cachedQueue);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
We are pushing data to the queue as shown below:
ObjectMessage contextMessage = session.createObjectMessage();
contextMessage.setObject(context);
producer.send(contextMessage);
Application runs fine for few days and we have a situation sometimes that, "producer.send(contextMessage);"
is getting blocked. Its returning only after sometime (sometimes ~15s to 15 min).
This pushing to the queue happens within a bean managed transaction. (This transaction includes database operation such as update, insert and delete as well and as a final action, this data of collected information on what is being done is pushed to the queue )
This inturn makes the transaction inactive since the locks held by the transaction will not be committed.
There are 2 typical scenarios out of this.
It is observed sometimes that, eventhough producer call is not returned (Thread goes to the waiting state and returns later), consumer on the other end which is a MDB listening to the queue and responding to onMessage:
MDBean implements MessageListener{
public void onMessage(Message msg) {
ObjectMessage objMsg = (ObjectMessage) msg;
objMsg.getObject();
}
}
Sometimes, eventhough, producer.send() has not returned, on the other end, message is being already processed.
But, on the other scenario, message is not consumed.
Is there anything wrong in the code? We are failing to understand why producer is getting blocked!
Any hints would really be helpful.
Thanks a lot in advance!
-
18. Re: producers blocked
jbertram Jan 30, 2017 4:35 PM (in response to manu29585)Start a new forum thread with your question rather than commenting on multiple old threads.