Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
final JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint(<application>, JAXRSServerFactoryBean.class);
factory.setFeatures(Arrays.asList(new SseFeature()));
...
return factory.create();

Additional Properties

There are a couple of contextual properties which allow to fine-tune the Apache CXF SSE implementation to a particular context.

PropertyDescriptionDefault
org.apache.cxf.sse.sink.buffer.size

By default, the SSE events are scheduled in batches and than flushed one by one.
If the buffer overflows, no more events are going to be accepted (and consequently, the error is returned).
The size of the buffer could be controlled using this property (if default is not suitable).

10000

OSGi

For the deployments inside OSGi containers (like Apache Karaf), Apache CXF provides a dedicated cxf-sse feature (which depends on cxf-http and cxf-jaxrs).

...