I am trying to add a static field in the MessageDrivenBean to count how many total message this particular type of Bean processed.
Is this the right way to do it? Do I need to synchronize when I increase the counter? Will JBoss take care of the synchronize for me automatically?
I was read somewhere that by default JBoss can have 15 concurrent message processing. Is that true? Where can I find more document?
There are already processing statistics stored in the JBoss server. You can see them via the JMX console under the "jboss.mq.destination" category.
If you're using a static variable, then you need to synchronize on some sort of static lock. JBoss will create up to 15 MDB objects. You should use something like SynchronizedInteger in concurrent.jar.