This content has been marked as final.
Show 3 replies
-
1. Re: configuration-name / How to limit MDB instances
genman Aug 7, 2004 1:01 PM (in response to renen)
Yes. Do a little cut&pasting of standardjboss.xml and create your own configuration similar to the SingletonMessageDrivenBean. -
2. Re: configuration-name / How to limit MDB instances
stephanenicoll Aug 9, 2004 4:42 PM (in response to renen)Adrian posted a solution in the FAQ.
Regards,
Stephane -
3. Re: configuration-name / How to limit MDB instances
renen Aug 16, 2004 7:13 AM (in response to renen)Hello.
Thanks to both genman and Stephane.
I'm afraid that I'm a bit of a lowbrow when it comes to these kinds of things. I was not able to easily figure out from Adrian's FAQ how I should proceed. It was useful only in that it pointed me in the right direction, but genman's contribution was more useful.
For future generations, what you do to control the number of instances of an MDB are servicing a queue, is define your jboss.xml as follows:<jboss> <unauthenticated-principal>nobody</unauthenticated-principal> <invoker-proxy-bindings> <invoker-proxy-binding> <name>email-message-driven-bean</name> <invoker-mbean>default</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI> <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI> <MaximumSize>4</MaximumSize> <MaxMessages>1</MaxMessages> <MDBConfig> <ReconnectIntervalSec>10</ReconnectIntervalSec> <DLQConfig> <DestinationQueue>queue/DLQ</DestinationQueue> <MaxTimesRedelivered>10</MaxTimesRedelivered> <TimeToLive>0</TimeToLive> </DLQConfig> </MDBConfig> </proxy-factory-config> </invoker-proxy-binding> </invoker-proxy-bindings> <enterprise-beans> <message-driven> <ejb-name>MailHandler</ejb-name> <configuration-name>Standard Message Driven Bean</configuration-name> <destination-jndi-name>queue/mailQueue</destination-jndi-name> <invoker-bindings> <invoker> <invoker-proxy-binding-name>email-message-driven-bean</invoker-proxy-binding-name> </invoker> </invoker-bindings> </message-driven> </enterprise-beans> <resource-managers> </resource-managers> </jboss>
The bit that matters is the line<MaximumSize>4</MaximumSize>
Just to make things quite clear: the file jboss.xml sits in the META-INF directory of the jar in which your MDB lives.
I hope I got that right! Clearly I'm new to JMS, so if there are better ways of killing this cat, please let me know.
Renen.