You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "John D. Ament" <jo...@gmail.com> on 2018/02/04 19:49:41 UTC

How to use rx() with proxy clients?

So far, it looks like proxy clients don't support rx() invocations.  I do
see rx() methods within WebClient that would allow its use, but I don't see
a straight forward way that those methods could be invoked within a proxy.
It could be that a custom annotation is used, indicating the response
should be from an rx() invocation.

John

Re: How to use rx() with proxy clients?

Posted by Sergey Beryozkin <sb...@gmail.com>.
I'd try a property option.
As soon the proxy interface gets enhanced with the extra non domain 
specific parameters then IMHO it just becomes
less obvious why the proxy is even used, using the JAX-RS api just 
becomes an immediately better alternative...

Cheers, Sergey
On 05/02/18 09:02, Romain Manni-Bucau wrote:
> The two lasts options sounds the most natural to me and the first one
> can be emulated with the second one propably.
> 
> AFAIK the async is only supported by having an InvocationCallback
> which means you put in the request context an instance from an
> interceptor currently in the proxy API - don't think it is wired
> somewhere else
> 
> and in any case it is not the rx() call.
> 
> 
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
> 
> 2018-02-04 23:46 GMT+01:00 John D. Ament <jo...@apache.org>:
> 
>> Yes, treating it like a MBR would work.  However, there needs to be a way
>> as you mention to make it go async.  I'm more trying to see if this is
>> already supported somehow.
>>
>> There's a few ways I could see executor working:
>>
>> - when building the proxy, include an executor() method (I think this is
>> already inherited from JAX-RS 2.1)
>> - use a property() call (already supported it seems in the core client)
>> - one of the method arguments on the proxy
>>
>> John
>>
>> On Sun, Feb 4, 2018 at 3:12 PM Romain Manni-Bucau <rm...@gmail.com>
>> wrote:
>>
>>> Why not using the response type? It is not hard to detect it is a
>>> CompletionStage and therefore call rx().
>>>
>>> Side note: if there is an Executor param it should be
>> forwarded/configured
>>> IMHO.
>>>
>>> Le 4 févr. 2018 20:49, "John D. Ament" <jo...@gmail.com> a écrit
>> :
>>>
>>>> So far, it looks like proxy clients don't support rx() invocations.  I
>> do
>>>> see rx() methods within WebClient that would allow its use, but I don't
>>> see
>>>> a straight forward way that those methods could be invoked within a
>>> proxy.
>>>> It could be that a custom annotation is used, indicating the response
>>>> should be from an rx() invocation.
>>>>
>>>> John
>>>>
>>>
>>
> 


Re: How to use rx() with proxy clients?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
The two lasts options sounds the most natural to me and the first one
can be emulated with the second one propably.

AFAIK the async is only supported by having an InvocationCallback
which means you put in the request context an instance from an
interceptor currently in the proxy API - don't think it is wired
somewhere else

and in any case it is not the rx() call.



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

2018-02-04 23:46 GMT+01:00 John D. Ament <jo...@apache.org>:

> Yes, treating it like a MBR would work.  However, there needs to be a way
> as you mention to make it go async.  I'm more trying to see if this is
> already supported somehow.
>
> There's a few ways I could see executor working:
>
> - when building the proxy, include an executor() method (I think this is
> already inherited from JAX-RS 2.1)
> - use a property() call (already supported it seems in the core client)
> - one of the method arguments on the proxy
>
> John
>
> On Sun, Feb 4, 2018 at 3:12 PM Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Why not using the response type? It is not hard to detect it is a
> > CompletionStage and therefore call rx().
> >
> > Side note: if there is an Executor param it should be
> forwarded/configured
> > IMHO.
> >
> > Le 4 févr. 2018 20:49, "John D. Ament" <jo...@gmail.com> a écrit
> :
> >
> > > So far, it looks like proxy clients don't support rx() invocations.  I
> do
> > > see rx() methods within WebClient that would allow its use, but I don't
> > see
> > > a straight forward way that those methods could be invoked within a
> > proxy.
> > > It could be that a custom annotation is used, indicating the response
> > > should be from an rx() invocation.
> > >
> > > John
> > >
> >
>

Re: How to use rx() with proxy clients?

Posted by "John D. Ament" <jo...@apache.org>.
Yes, treating it like a MBR would work.  However, there needs to be a way
as you mention to make it go async.  I'm more trying to see if this is
already supported somehow.

There's a few ways I could see executor working:

- when building the proxy, include an executor() method (I think this is
already inherited from JAX-RS 2.1)
- use a property() call (already supported it seems in the core client)
- one of the method arguments on the proxy

John

On Sun, Feb 4, 2018 at 3:12 PM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Why not using the response type? It is not hard to detect it is a
> CompletionStage and therefore call rx().
>
> Side note: if there is an Executor param it should be forwarded/configured
> IMHO.
>
> Le 4 févr. 2018 20:49, "John D. Ament" <jo...@gmail.com> a écrit :
>
> > So far, it looks like proxy clients don't support rx() invocations.  I do
> > see rx() methods within WebClient that would allow its use, but I don't
> see
> > a straight forward way that those methods could be invoked within a
> proxy.
> > It could be that a custom annotation is used, indicating the response
> > should be from an rx() invocation.
> >
> > John
> >
>

Re: How to use rx() with proxy clients?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Why not using the response type? It is not hard to detect it is a
CompletionStage and therefore call rx().

Side note: if there is an Executor param it should be forwarded/configured
IMHO.

Le 4 févr. 2018 20:49, "John D. Ament" <jo...@gmail.com> a écrit :

> So far, it looks like proxy clients don't support rx() invocations.  I do
> see rx() methods within WebClient that would allow its use, but I don't see
> a straight forward way that those methods could be invoked within a proxy.
> It could be that a custom annotation is used, indicating the response
> should be from an rx() invocation.
>
> John
>