I have two jvm apps which are processing messages off a JMS queue.
I know that you can have multiple consumers of a queue but is it possible to have a queue configured where the initial consumer can connect but any subsequent consumers will receive an exception when they try to connect.
I'm just considering if this could be used to implement some failover functionality where one consumer could connect to a queue and become the active consumer. Any other consumers which try and connect would fail and become passive. A timer in the passive consumers could periodically try and reconnect to the queue.
If it is possible where would it be configured ?
regards and thanks
If you really choose such solution, I think you could use CLIENTID column in JMS users table.
JMS_USERS (USERID VARCHAR(32) NOT NULL, ..., CLIENTID VARCHAR(128) NULL
Then consecutive user with the same client_id throws Exception during connect. I havent tried it , but ocassionally I accidentally I got such excecptions during configuring JMS