In Universal Messaging, a client can register an asynchronous subscriber which will be called when an event arrives in the channel. I’m curious about how it works.
Does the client that has registered an asynchronous subscriber constantly perform polling on the channel (and, if an event is detected, calls the
go method of the subscriber)? Or does it work in some other way? Could an expert please shed some light on it?
Async consuming registers interest with UM server to receive events, this interest is maintained until removed by the consumer or the Connection is severed.
UM server will upon receiving a message forward it to that consumer when it arrives if all conditions like filtering and outstanding event limits are met.
It is a very efficient mechanism for consuming as it is server driven rather than polling so ends up as a more event driven process in comparison to sync consuming where a request polls using timeouts.
Does this mean that the consumer has to have a port open so that it can receive and process requests? Or how exactly is that forwarding done?
I have to know this because I might have to setup the environment correctly for it to work, i.e. configure the firewall etc.
Do you know whether the JMS interface use the async subscribers model? I.e. if I subscribe to a JMS topic (backed by a channel): woulld an async consumer be registered?
A TCP connection will be created for the life of a nSession to UM server, this is persistent and thus as long as that session is alive we have a bidirectional socket connected allowing the server to send whenever it likes, so as long as you can connect to the UM server you have no further infra configuration in general.
JMS has both sync API’s by the receive methods and async via a MessageListener, it is your choice.