Jolokia 2.0 - JMX Notifications
This screencast gives a live demo of the forthcoming JMX notification support in Jolokia 2.0.
Jolokia supports currently two notification modes. In all modes, the Jolokia agent itself subscribe to a JMX notification locally and then dispatches the notifications to its clients.
- Pull Mode : Here, the agent keeps the notification received for a client in memory and sends it back on an JMX request to a Jolokia specific MBean. A client typically queries this notification MBean periodically.
- SSE Mode : Server Sent Events are a W3C standard for pushing events from an HTTP server to a client. With this mode the Jolokia agents directly pushes any notification it receives to the client. The advantage is of course a much lower latency compared to the pull mode, but SSE is not available for Internet Explorer, including 11. What a pity.
The Jolokia protocol has been extended with the top level action notification
and subcommands.
register
/unregister
: Register / unregister a notification clientadd
/remove
: Add / remove a listener subscriptionlist
: list all subscriptions for a clientping
: Keep subscription aliveopen
: Use for creating a back channel. E.g. the SSE mode keeps this GET request for pushing back an event stream.
Currently only the new Jolokia JavaScript client supports JMX notification. If you are interested in having it in other clients (e.g. Java), too, please let me know. I would be more than happy for coders jumping on the Jolokia bandwagon since there is still quite some stuff to do for 2.0.
The source code to this demo and the new Jolokia JavaScript client is on GitHub: https://github.com/jolokia-org/jolokia-client-javascript.