[jax-rs-spec users] Re: Proposal for RX API Improvement

From: Markus KARG <>
Date: Sat, 21 Jan 2017 08:35:36 +0100



no, this is not a type. The code sample shows that reactive programming is
possible already with JAX-RS 2.0 when done explicitly by the application
programmer, so the code improvement I suggested should work not only with
the new RX support, but also with "plain" async support.


When addressing the Executor topic, there is one more issue to check I filed it back in 2014, and
it is covering the same issue.





From: Pavel Bucek []
Sent: Freitag, 20. Januar 2017 19:30
Subject: Re: Proposal for RX API Improvement


Hi Marcus,

that was already brought by Adam, just after we started - see

I plan to tackle that right after we are finished with Rx Client and maybe
SSE, since that will most likely have wider impact (not limited to reactive
support) and I'd like to have it made for the whole API at once.

(your code sample does not contain rx() method in the chain - I hope that's
just a typo. I believe when the executor service is set, it should be used
for all async operations, including AsyncInvoker, RxInvoker and possibly
NioInvoker (whatever that will be)).

Best regards,

On 20/01/2017 19:12, Markus KARG wrote:



the proposed RX API allows to explicitly provide an Executor.


I assume that typical applications will only use one or two Executors, and
typically a Java EE application will always use the Default Managed Executor
Service of the container.


So maybe it would be a good idea if we can get rid of repeating the Executor
again and again for each invocation, and provide an optional way to set a
"Default Executor" directly with the Client instance?


final Client client = ClientBuilder.newClient(MY_IO_BOUND_EXECUTOR); //
overriding implicit default executor

final CompletableFuture<String> getA ="some uri
A").request().get(); // using MY_IO_BOUND_EXECUTOR


What do you think?