Hi Stan,
Yes. You can do that.
Assuming you mean to use only one shared durable subscriber and multiple clients connected to it to process the messages in load balancing way. In this case, only one of the connected client will get the message and process it and you don’t need to do anything special except setting client id sharing for connection. Refer to WmJMSConfig.setClientIDSharing(true) for more details. In this case, you will end up with a single durable subscriber (say Topic##Sub) that is getting connected from multiple client applications and only one of the client application will process the message.
If you are actually using multiple subscribers, e.g. Topic##Sub1, Topic##Sub2, etc, then spec compliant way is to use filters to ensure that only one durable subscriber gets the event.
But, using too many filters have performance penalty. Broker core functionality just has a simple queue implementation that supports both deliver to a specific queue as well as publish to all subscribing queues. So, technically it is possible to have Topic##Sub1 and Topic##Sub2 and then use send API to queue to message to only one of the queue. Something like using MessageProducer.send(queue,message)
instead of using TopicPublisher.publish(message)
where queue
variable is not actually a JMS Queue but points to specific JMS Durable Subscriber. This will be hackish way, and it certainly will work if you start using Broker implementation classes instead of standard JMS interfaces. This will be last approach, when you must use multiple durable subscribers and don’t want to have filter performance penalty too.
#Universal-Messaging-Broker#webMethods