-
1. Re: better performance - how to manage an asynchronous queue
genman Nov 13, 2003 12:11 PM (in response to dhartford)
Edit your jboss.xml file. Add to the end a container-configurations XML block. Set the maximum size to whatever you like:
<enterprise-beans>
</enterprise-beans>
<container-configurations>
<container-configuration>
<container-name>Standard Message Driven Bean</container-name>
<container-invoker-conf>
DefaultJMSProvider
StdJMSPool
3
1
True
</container-invoker-conf>
</container-configuration>
</container-configurations> -
2. Re: better performance - how to manage an asynchronous queue
computerrobot Nov 14, 2003 4:42 PM (in response to dhartford)Hi,
Using JBoss 3.2.2RC4
I have been trying to limit the maximum number of instances of MDB for a while now. I have looked through the forum and saw little variations of similar code that needs to be changed in jboss.xml. And none of them work for me. Changing standardjboss.xml works.
I started with Adrian's simple example : http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= modifying it with your recommendations, this is what my jboss.xml looks like.
----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<container-configurations>
<container-configuration>
<container-name>Standard Message Driven Bean</container-name>
<container-invoker-conf>
DefaultJMSProvider
StdJMSPool
3
1
True
</container-invoker-conf>
</container-configuration>
</container-configurations>
<enterprise-beans>
<message-driven>
<ejb-name>test/mdb</ejb-name>
<destination-jndi-name>queue/testQueue</destination-jndi-name>
</message-driven>
</enterprise-beans>
---
I also tried Adrian's solution after which my jboss.xml would look like this :
----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<container-configurations>
<container-configuration extends="Standard Message Driven Bean">
<container-name>My Message Driven Bean</container-name>
<container-invoker-conf>
DefaultJMSProvider
StdJMSPool
1
1
true
10
queue/DLQ
10
0
</container-invoker-conf>
</container-configuration>
</container-configurations>
<enterprise-beans>
<message-driven>
<ejb-name>test/mdb</ejb-name>
<destination-jndi-name>queue/testQueue</destination-jndi-name>
</message-driven>
</enterprise-beans>
---
Could anyone tell why it doesn't work! -
3. Re: better performance - how to manage an asynchronous queue
genman Nov 14, 2003 7:06 PM (in response to dhartford)
I set to 3 in jboss.xml, you may want to use 1.
You should validate your jboss.xml against its DTD.
http://www.jboss.org/j2ee/dtd/jboss.dtd
The jboss.xml XML loader doesn't do any DTD validation, so if you cut and pasted something wrong, your configuration may be ignored. The container configuration goes at the end, BTW... -
4. Re: better performance - how to manage an asynchronous queue
computerrobot Nov 17, 2003 9:34 AM (in response to dhartford)I tried putting container configuration at the bottom, but no use. The xml does NOT validate against the DTD because DTD has no element for message-driver beans! It only expects session or entity. Here is my jboss.xml doc.
-----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
<enterprise-beans>
<message-driven>
<ejb-name>test/mdb</ejb-name>
<destination-jndi-name>queue/testQueue</destination-jndi-name>
</message-driven>
</enterprise-beans>
<container-configurations>
<container-configuration>
<container-name>Standard Message Driven Bean</container-name>
<container-invoker-conf>
DefaultJMSProvider
StdJMSPool
3
1
True
</container-invoker-conf>
</container-configuration>
</container-configurations>
-----
Thanks. -
5. Re: better performance - how to manage an asynchronous queue
computerrobot Nov 17, 2003 9:37 AM (in response to dhartford)By the way, the reason I think this is not working is :
Inside onMessage, I print out the hashcode and then do Thread.sleep(30000). As messages keep
getting posted on the queue, I keep seeing new hashCodes (it stops when 15 of them have been created).
Thanks