I'm trying to get the RxJava support working using CXF 3.2.2 and Spring
Boot (1.5.10.RELEASE). I am using the following CXF libraries explicitly
(including transitive dependencies):

cxf-spring-boot-starter-jaxrs
cxf-rt-rs-extension-reactivestreams
cxf-rt-rs-extension-rx
io.reactivex.rxjava2:rxjava:2.1.3

I am following (I think) the instructions here:

http://cxf.apache.org/docs/jax-rs-rxjava.html#JAX-RSRxJava-Introduction


I have created the following CXF feature for installing the
ReactiveIOInvoker:

@Provider(value = Provider.Type.Feature,scope = Provider.Scope.Server)
public class RxJavaFeature extends AbstractFeature {
  @Override
  public void initialize(Server server, Bus bus) {
    final ReactiveIOInvoker invoker = new ReactiveIOInvoker();
    invoker.setUseStreamingSubscriberIfPossible(true);
    server.getEndpoint().getService().setInvoker(invoker);
  }
}

On the client side (this uses the framework that I mentioned yesterday),
I'm installing a FlowableRxInvokerProvider and an
ObservableRxInvokerProvider. My response keeps showing up empty, even
though I'm returning a Flowable.just(<MyReturnObject>):


2018-02-23 10:32:07.547 INFO 89838 --- [o-auto-1-exec-1]
o.a.cxf.services.RxJavaHelloImpl.REQ_IN : REQ_IN
Address: http://localhost:64452/api/hello/RxJava
HttpMethod: GET
ExchangeId: 0bb9cac2-7d48-4368-bb30-3c75948b0669
Headers: {Accept=application/json, host=localhost:64452,
connection=keep-alive, cache-control=no-cache, pragma=no-cache,
user-agent=Apache-CXF/3.2.2}


2018-02-23 10:32:07.575 INFO 89838 --- [o-auto-1-exec-1]
o.a.c.services.RxJavaHelloImpl.RESP_OUT : RESP_OUT
Content-Type: application/json
ResponseCode: 200
ExchangeId: 0bb9cac2-7d48-4368-bb30-3c75948b0669
Headers: {Date=Fri, 23 Feb 2018 15:32:07 GMT, Content-Type=application/json}
Payload: {}

Did I miss a step?

Thanks,

James

Reply via email to