cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andriy Redko <drr...@gmail.com>
Subject Re: RxJava2 and Spring Boot?
Date Sat, 24 Feb 2018 13:47:06 GMT
Hi James,

Seems like everything is in place, should be working fine. Would you 
mind please to share the the @GET implementation? Could it be that 
your object serializes to empty json (ignore nullable props, etc)? 
Thanks.

Best Regards,
    Andriy Redko

Friday, February 23, 2018, 10:39:01 AM, you wrote:

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

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

JC> I am following (I think) the instructions here:

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


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

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

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


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


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

JC> Did I miss a step?

JC> Thanks,

JC> James


Mime
View raw message