-
1. Re: ConsumerMaxRate on MDB not working
timfox Mar 10, 2010 9:12 AM (in response to rnicholson10)By default there will be multiple instances of your MDB (I thiink default is 10 or 15), so if each one is consuming 1 per second, then overall rate will be 10 or 15 per second right? -
2. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 9:40 AM (in response to timfox)Ok, this is probably not the right place to ask this question but can I define how many MDB's are running for a particular MDB? -
3. Re: ConsumerMaxRate on MDB not working
timfox Mar 10, 2010 9:52 AM (in response to rnicholson10)I believe you set this on the MDB:
@ActivationConfigProperty(propertyName = "maxSession", propertyValue = "10")
In your case, you want a singleton, so you'd set it to 1
-
4. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 9:58 AM (in response to timfox)Cool, I'm going to ask one more question.
Do you know if it's possible to define this via an XML file. I deploy the same MDB on several different environments (as part of an ear). I only want a singleton on one of those environments (it has an old, slow db).
Cheers,
R.
-
5. Re: ConsumerMaxRate on MDB not working
timfox Mar 10, 2010 10:02 AM (in response to rnicholson10)I'm not sure.
You should ask in the EJB forum, since this is MDB, not HornetQ config
-
7. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 10:39 AM (in response to jaikiran)Jaikiran,
Does this mean I can't deploy this MDB with an annotation like this:
activationConfig = {
@ActivationConfigProperty(
propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(
propertyName="destination",
propertyValue="queue/phaseQueueFromEngine"),
@ActivationConfigProperty(
propertyName="DeliveryActive",
propertyValue="false")
}
)@ResourceAdapter("hornetq-ra.rar")
public class HandlerMDB implements MessageListener{
}
So I'd need to specify all the above in an ejb-jar.xml instead but I am unsure how to specifiy the resource adapter?
ejb-jar.xml:
<message-driven>
<ejb-name>HandlerMDB</ejb-name>
<ejb-class>com.paddypower.phase.handler.bean.mdb.HandlerMDB</ejb-class>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>queue/phaseQueueFromEngine</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>DeliveryActive</activation-config-property-name>
<activation-config-property-value>false</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
Any ideas?
Cheers,
R. -
8. Re: ConsumerMaxRate on MDB not working
jaikiran Mar 10, 2010 10:45 AM (in response to rnicholson10)rnicholson10 wrote:
Jaikiran,
So I'd need to specify all the above in an ejb-jar.xml instead but I am unsure how to specifiy the resource adapter?
The resource adapter name can go in jboss.xml
<message-driven> <ejb-name>HandlerMDB</ejb-name> <resource-adapter-name>hornetq-ra.rar</resource-adapter-name> </message-driven>
-
9. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 10:59 AM (in response to rnicholson10)Thanks! -
10. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 5:55 PM (in response to jaikiran)Just so you guys know. It is not possible to have a singleton MDB.
I tried the following:
1) I set the maximum size in standardjboss.xml
2) I set the maxSession value on the activation config annotation
3) I deployed the MDB using the xml instead of annotations
None of these worked.
My final solution was to write a concurrent timed queue to feed from the OnMessage call into the our packet processor.
Cheers and thanks for your help.R.
-
11. Re: ConsumerMaxRate on MDB not working
timfox Mar 10, 2010 5:58 PM (in response to rnicholson10)That's very odd. It certainly should work.
Perhaps Andy or Clebert could look into this as they are working in this area at the moment?
If maxSessions and pool size don't work this would be a serious bug in JBoss AS / HornetQ JCA adapter
-
12. Re: ConsumerMaxRate on MDB not working
rnicholson10 Mar 10, 2010 6:06 PM (in response to timfox)Agreed. I came across many posts of people having similar problems.
I could not find a working example anywhere using any messaging provider so it may not be a HornetQ issue at all.