Versions Compared

Key

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

...

Code Block
final JAXRSServerFactoryBean factory = RuntimeDelegate.getInstance().createEndpoint(<application>, JAXRSServerFactoryBean.class);
factory.setTransportId(SseHttpTransportFactory.TRANSPORT_ID);
...
return factory.create();

Advanced Configuration

Since Apache CXF 3.2.3 release, it is possible to use alternative means to configure transports, include SSE one, by setting it through Bus property "org.apache.cxf.preferred.transport.id" (also available as AbstractTransportFactory.PREFERRED_TRANSPORT_ID). With this property set to preferred transport, CXF servlet is going to pick it up instead of using the default one. SSE implementation benefits from that and in many cases setting the "transportId" init parameter on the servlet level could be omitted.