You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by David Karlsen <da...@gmail.com> on 2015/12/10 10:40:45 UTC

WS-addressing - decoupled responses over JMS?

Hi.

I have a wsdl which is request/reply (e.g. no one way operations).
To increase throughput I'd like operations to be processed asynchronous - e.g. :
1. clients puts request onto queue - when put on queue client is
*unblocke*d and continue other actions - e.g. not sitting and waiting
for a response.
2. receiver picks up message, handles it and replies to client on some
given responseQueue
3. client has listener - and given the nature of our payload we'd be
able to correlate it to the request in 1.

I'm aware the async bindings for JAX-WS - but this is not what I want
as they are semi-async and not long-living (either over HTTP or JMS) -
and are in essence synchronous req/res given that my MEP in the WSDL
is InOut and not OneWay.

I'm now looking into ws-addressing and decoupled responses (inspired
by http://ashakirin-cxf-async.blogspot.no/) and it looks like a
perfect fit - I could keep my WSDL as is - but achieve the processing
pattern outlined above - but I have a hard time configuring it - I've
found examples for HTTP - but not when using JMS.

I am also wondering if the replyToDestination (e.g. response queue)
would need to be encoded into WSA headers - or can be kept on the JMS
messaging level (e.g. use JMSReplyTo property).

Also - is my understanding of WSA w/ deoupled responses correct?
Referrring (inspired by http://ashakirin-cxf-async.blogspot.no/) -
will the invoking client/thread terminate at 8 - and a new thread be
activated at point 13 in that diagram?



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

RE: WS-addressing - decoupled responses over JMS?

Posted by Andrei Shakirin <as...@talend.com>.
Hi David,

I think the simplest way it to use standard async JAX-WS client (generated, Dispatch or dynamic) with JMS transport.

- In case of generated client you will have additional async methods:
    public Future<?> methodNameAsync(Type requestType, AsyncHandler<Type> asyncHandler);
    public Response<Type> methodNameAsync(Type requestType);

- Dispatch: Future<?> invokeAsync(T msg, AsyncHandler<T> handler)
- Proprietary CXF Dynamic Client: void invoke(ClientCallback callback, BindingOperationInfo oi, Object... params)

See this blog for details: http://ashakirin-cxf-async.blogspot.de/2014/03/asynchronous-api.html

CXF JMS Transport will recognize async calls, wouldn't block your client and invoke your callback or initialize the Future when response will be ready.
I think you don't need special configuration in this case.

Regards,
Andrei.

> -----Original Message-----
> From: David Karlsen [mailto:davidkarlsen@gmail.com]
> Sent: Donnerstag, 10. Dezember 2015 10:41
> To: users@cxf.apache.org
> Subject: WS-addressing - decoupled responses over JMS?
> 
> Hi.
> 
> I have a wsdl which is request/reply (e.g. no one way operations).
> To increase throughput I'd like operations to be processed asynchronous -
> e.g. :
> 1. clients puts request onto queue - when put on queue client is
> *unblocke*d and continue other actions - e.g. not sitting and waiting for a
> response.
> 2. receiver picks up message, handles it and replies to client on some given
> responseQueue 3. client has listener - and given the nature of our payload
> we'd be able to correlate it to the request in 1.
> 
> I'm aware the async bindings for JAX-WS - but this is not what I want as they
> are semi-async and not long-living (either over HTTP or JMS) - and are in
> essence synchronous req/res given that my MEP in the WSDL is InOut and
> not OneWay.
> 
> I'm now looking into ws-addressing and decoupled responses (inspired by
> http://ashakirin-cxf-async.blogspot.no/) and it looks like a perfect fit - I could
> keep my WSDL as is - but achieve the processing pattern outlined above - but
> I have a hard time configuring it - I've found examples for HTTP - but not
> when using JMS.
> 
> I am also wondering if the replyToDestination (e.g. response queue) would
> need to be encoded into WSA headers - or can be kept on the JMS
> messaging level (e.g. use JMSReplyTo property).
> 
> Also - is my understanding of WSA w/ deoupled responses correct?
> Referrring (inspired by http://ashakirin-cxf-async.blogspot.no/) - will the
> invoking client/thread terminate at 8 - and a new thread be activated at point
> 13 in that diagram?
> 
> 
> 
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Re: WS-addressing - decoupled responses over JMS?

Posted by Christian Schneider <ch...@die-schneider.net>.
I think WSA headers will not really help there as the JMS transport would
still do the correlation based on the JMS correlation id for any request
reply messages.

What you describe is a correlation on the user level so I would recommend
to use real one way messages. You can even do this without WSA as you can
give a fixed replyTo queue on the endpoint.

Christian

2015-12-10 10:40 GMT+01:00 David Karlsen <da...@gmail.com>:

> Hi.
>
> I have a wsdl which is request/reply (e.g. no one way operations).
> To increase throughput I'd like operations to be processed asynchronous -
> e.g. :
> 1. clients puts request onto queue - when put on queue client is
> *unblocke*d and continue other actions - e.g. not sitting and waiting
> for a response.
> 2. receiver picks up message, handles it and replies to client on some
> given responseQueue
> 3. client has listener - and given the nature of our payload we'd be
> able to correlate it to the request in 1.
>
> I'm aware the async bindings for JAX-WS - but this is not what I want
> as they are semi-async and not long-living (either over HTTP or JMS) -
> and are in essence synchronous req/res given that my MEP in the WSDL
> is InOut and not OneWay.
>
> I'm now looking into ws-addressing and decoupled responses (inspired
> by http://ashakirin-cxf-async.blogspot.no/) and it looks like a
> perfect fit - I could keep my WSDL as is - but achieve the processing
> pattern outlined above - but I have a hard time configuring it - I've
> found examples for HTTP - but not when using JMS.
>
> I am also wondering if the replyToDestination (e.g. response queue)
> would need to be encoded into WSA headers - or can be kept on the JMS
> messaging level (e.g. use JMSReplyTo property).
>
> Also - is my understanding of WSA w/ deoupled responses correct?
> Referrring (inspired by http://ashakirin-cxf-async.blogspot.no/) -
> will the invoking client/thread terminate at 8 - and a new thread be
> activated at point 13 in that diagram?
>
>
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>