I'm having trouble designing a publish/subscribe service which will run on JBoss ESB. I need to be able to publish a message to a topic, which probably 200 subscribers will be listening to, and they will do something with the message once they get it. I'm writing the publish service and a sample subscriber service to showcase how it might be done.
I need to have guaranteed delivery to these subscribers. If they go offline for a period of time, and messages get published within that time, when they come back online, those messages need to be delivered. So I think that means they need to be durable subscribers (my understanding is the Topic is not durable, but the subscribers are defined as durable).
I have a publish service right now which sticks an ESB message on an ESB Aware Queue, which calls a NotifyTopic, which sticks the message on an ESB-Unaware Topic. I have a Subscriber which has a listener for the ESB-Unaware topic, and this calls a webservice using an httprouter which sends the message off to be processed by my webservice. That all works - except when my webservice is offline (I have to figure out how to handle that scenario, but I'm not even there yet), or if my ESB Subscriber Service is offline (which I test by uninstalling it, sending a few publish messages, and reinstall it - no backlog of messages get sent to my webservice).
I'm pretty sure I'm not building the subscriber correctly. I thought I needed the subscriber to be deployed on the ESB. I'm not sure how it would work otherwise, how it would be deployed on a different server and then still be connected to the ESB (trying to avoid having to mess with mutual ssl, firewalls, ports, etc). I figured having the subscriber installed on the ESB would be the best option. But I don't know how to get it to be durable/have guaranteed delivery.
A quote from Creating Robust JMS Applications
I have run some tests using JBoss 7
and the JMS server buffers the messages for each disconnected subscriber properly.