As a developer I need to have a JMS clustered so that only one node processes a task (task mean queue message) and tasks can be processed by another node when one goes down.
Assumptions:
- JMS queue is replicated on a cluster nodes
- task is only processed once (at one node, without distributed queues)
- tasks are continuously processed even when some nodes are taken down
- application can be run on a single node without code changes or recompilation
Application technology stack at the moment:
Web application based on Spring 3.2.X and with embedded ActiveMQ broker which staring during application initialization (< amq:broker />) without persistence. Only this application use created broker. Application running on JBoss 5.0.1.
Now I have to decide which approach we will use for fail-over clustering mentioned above. I was thinking about switch to JBoss messaging (provided by that version of JBoss) but I noticed that this implementation is old and has a lot of bugs.
Currently I hesitate between following possibilities:
- embedded ActiveMQ on two JBoss nodes (http://activemq.apache.org/integrating-apache-activemq-with-jboss.html) connected as cluster
- only deploy ActiveMQ to JBoss without integration (I noticed that ActiveMQ 5.9 starts without integration mentioned under above link at activemq-jms-ds.xml and I can connect to JMS directly, without connection factory and JNDI defined at Spring). Am I right ?
- two embedded brokers starting with Spring application on both nodes and connected as cluster (?) Is it possible ?
- separately started two ActiveMQ servers connected as cluster (newer version of ActiveMQ doesn't require container and can run separately)
Which of above could be the best ? Should I do that another way ?
JMS clustering is relatively new for me so all comments / remarks are welcome.