[jboss-user] [EJB 3.0] - Re: My MdB receives the same message again and again
schausson
do-not-reply at jboss.com
Mon Feb 9 05:59:27 EST 2009
The processing might take from a few seconds to dozens of minutes, depending on the message content...
But to reply to your question, even with the org.jboss.annotation.ejb.TransactionTimeout annotation (I specified 100000 seconds just to give it a try), the processing stops after 'about' 5 minutes...
The full code of my onMessage() method :
/**
* {@inheritDoc}
*/
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@TransactionTimeout(value=100000)
public void onMessage(Message arg0)
{
final ObjectMessage om = (ObjectMessage)arg0;
try {
System.out.println("received message : " + arg0);
final MyParameter plp = (MyParameter)om.getObject();
myProcessingMethod(plp); // This method might take dozens of minutes...
} catch (JMSException e) {
logger.logError(e);
} catch (Exception e) {
System.out.println("#############################################################################");
e.printStackTrace();
}
}
By the way, I also tried to implement the callback method setMessageDrivenContext(MessageDrivenContext) to store the context in a Mdb field so that I can check ctx.getRollbackOnly(), but it seems that the container does not invoke this method ... Did I miss something here as well ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4208124#4208124
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4208124
More information about the jboss-user
mailing list