There are multiple aspects to your question. First of all: if you use JDBC Persistence for your MQ you will get a lot of inserts/updates/delets for every message sent. This means JMS is in this scenario never faster than inserting directly into the database. If you use different persistence the speed depends on the implementation (JbossMQ is rather slow with filesystem, HornetQ is pretty fast). If you use a Null Persitence provider (or use temporary messages on a topic which is essentially in memory) its faster but lesss durable.
On the other side (consuming the messages) the throughput depends not only on the persitence provider, but also on the thread settings of the MDB and especially on the insert performance. If you DB cant handle more than 5 inserts/sec the MDB will not process more messages.
You should describe:
- your hardware landscape
- your software landscape (JBoss Version, MQ version, ...)
- the raw mdb speed (with an empty onMessage() method
- do you use xa?
otherwise we cant really give you answers.
A couple of things can be done to improve the performance at the message consumer, in this case on the MDB.
- Increase the number of JMS sessions in the JMS Server Session pool
- Increase the number of MDB instances
- Tune the database and increase the connection pool accordingly in your datasource configuration
You'd find ample amount of resources to get this done, hence not explained the steps.
Move on to JBossMessaging or HornetQ ;-)