users@jax-rs-spec.java.net

[jax-rs-spec users] Question on SSE API

From: Markus KARG <markus_at_headcrashing.eu>
Date: Fri, 3 Feb 2017 00:35:44 +0100

Experts,

 

we often see legacy JaveEE code in production that uses message-inflow by
non-JAX-APIs, for example clouds sending notifications by AMQP (hence JMS),
or on-premise systems sending notifications by JCA, or Swing Clients sending
change notifications by IIOP or SOAP (hence remote EJB), or session bean
timers are firing and so on.

 

In case a JAX-RS client shall be notified about such incoming events by
means of SSE, how can such non-JAX-RS event sources forward their
information into a JAX-RS SSE publisher?

 

Example: In a cloud scenario, a message driven bean is firing up because it
received an AMQP event. In turn JAX-RS clients shall be informed.

 

This is the #1 use case for SSE I do see for lots of soon-to-be-upgraded
legacy applications, so I assume it is planned that EJB containers can
inject the SSE publisher instance into SBs? If not that would mean that the
application programmers have to send http to the JAX-RS resource just to get
the SSE events being sent in turn, which might be an unwanted load when
running inside the same server instance anyways (yes, there are on-premise
non-cloud non-docker people out there).

 

-Markus