-
1. Re: Limit number of concurrent MDBs and number of retries?
kenrod Mar 26, 2006 9:19 PM (in response to kenrod)If it helps, this page...
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigJBossMDB
...seems to be exactly what I want, with its mention of MaxmimumSize and MaxTimesRedelivered, but how do I configure this in my EJB3 environment? -
2. Re: Limit number of concurrent MDBs and number of retries?
peter_kaas Mar 27, 2006 5:12 AM (in response to kenrod)We use:
@MessageDriven(activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Queue" ), @ActivationConfigProperty( propertyName = "destination", propertyValue = "queue/trigger/Stage1EventBatchQueue" ), @ActivationConfigProperty( propertyName = "minPoolSize", propertyValue = "1" ), @ActivationConfigProperty( propertyName = "maxPoolSize", propertyValue = "1" ) })
in our code. I think the minPoolSize and maxPoolSize are what you are looking for (that works for us).
As for getting a message just once: just make sure your MDB doesn't throw any exceptions by catching Throwable at the top of your onMessage()? -
3. Re: Limit number of concurrent MDBs and number of retries?
kenrod Mar 27, 2006 4:44 PM (in response to kenrod)Peter,
Fantastic! I will give that a try - it sounds like exactly what I need!
With regards to catching Exceptions, that one is more tricky: I do catch Exceptions at the top level of my onMessage (and don't rethrow them), but the message still gets re-delivered.
Looking at the stack trace of the Exception that I catch, there's a lot of references to jboss.aop in there, so I fear JBoss may be detecting the Exception and rolling back even though I am catching it.
Is there a parameter to limit the number of retries?
Regards,
Richard. -
4. Re: Limit number of concurrent MDBs and number of retries?
kenrod Mar 28, 2006 4:57 PM (in response to kenrod)For those travelling this way themselves, I found that using...
void onMessage( Message p_message ) { if ( p_message.getJMSRedelivered()) return; ...
...is a (slightly yucky) way of avoiding the resends. Of course, an ActivationConfigProperty would be better... -
5. Re: Limit number of concurrent MDBs and number of retries?
jsb Sep 28, 2006 1:13 AM (in response to kenrod)Came across this old topic looking for the answer to the same question... The ActivationConfigProperty that works for me with EJB3rc8 is:
@ActivationConfigProperty(propertyName = "DLQMaxTimesRedelivered", propertyValue = "0")