You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ronald Pieterse <ro...@gmail.com> on 2008/10/09 16:27:42 UTC
How to handle a large response object or attachment with CXF?
Hello.
In my service doing some time consuming stuff (reading email and handling
them) thus the connection is timing-out before I can start sending the
response. What way would I need to walk to keep the connection open? Is
there any way CXF can help in this?
Thnx,
Ronald
--
View this message in context: http://www.nabble.com/How-to-handle-a-large-response-object-or-attachment-with-CXF--tp19900120p19900120.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle a large response object or attachment with CXF?
Posted by Daniel Kulp <dk...@apache.org>.
Ronald,
You would need to create a client spring configuration that would configure
the http:conduit to use a "DecoupledEndpoint" for the response. If you look
at the "ws_addressing" sample, in src/demo/ws_addressing/client/client.xml,
you can see that the client is setting up a separate URL for the server to
call back on with the response. That URL will be put in the "reply-to"
ws-addressing header and the server will use that for the reply.
Dan
On Saturday 11 October 2008 10:00:35 am Ronald Pieterse wrote:
> I looked at WS-Addressing and got all the headers and stuff correct but I
> don't quite get how the delayed response would come back to the client. Is
> the client 'faking' an indefinite timeout or is something else suppose to
> happen?
> The facts of me not understanding this yet and that it needed to be done
> yesterday evening made me choose for option 2 at this moment, but I will
> probably go for WS-Addressing when I have it working since that would make
> working with asynchronous calls a lot easier. The configuration was as easy
> as expected.
> Great stuff guys!
> Will PHP and .NET clients be able to work with WS-Addressing? Anyone know
> issues with that?
>
> Ronald
>
> dkulp wrote:
> > Couple options:
> >
> > 1) Use a WS-Addressing decoupled endpoint for the response. The server
> > would
> > then basically send it back on a decoupled channel when it's ready.
> >
> > 2) Increase the timeout on the client side. We default it to 60
> > seconds, but
> > it's easily configured (or even turned off).
> >
> > 3) Use a more "callback" pattern where the client creates an endpoint to
> > get
> > the response, sends the endpoint reference with the request, then waits.
> > Quite a bit more work and essentially does what the case 1 above does.
> >
> > Dan
> >
> > On Thursday 09 October 2008 10:27:42 am Ronald Pieterse wrote:
> >> Hello.
> >>
> >> In my service doing some time consuming stuff (reading email and
> >> handling them) thus the connection is timing-out before I can start
> >> sending the response. What way would I need to walk to keep the
> >> connection open? Is there any way CXF can help in this?
> >>
> >> Thnx,
> >> Ronald
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: How to handle a large response object or attachment with CXF?
Posted by Ronald Pieterse <ro...@gmail.com>.
I looked at WS-Addressing and got all the headers and stuff correct but I
don't quite get how the delayed response would come back to the client. Is
the client 'faking' an indefinite timeout or is something else suppose to
happen?
The facts of me not understanding this yet and that it needed to be done
yesterday evening made me choose for option 2 at this moment, but I will
probably go for WS-Addressing when I have it working since that would make
working with asynchronous calls a lot easier. The configuration was as easy
as expected.
Great stuff guys!
Will PHP and .NET clients be able to work with WS-Addressing? Anyone know
issues with that?
Ronald
dkulp wrote:
>
>
>
> Couple options:
>
> 1) Use a WS-Addressing decoupled endpoint for the response. The server
> would
> then basically send it back on a decoupled channel when it's ready.
>
> 2) Increase the timeout on the client side. We default it to 60 seconds,
> but
> it's easily configured (or even turned off).
>
> 3) Use a more "callback" pattern where the client creates an endpoint to
> get
> the response, sends the endpoint reference with the request, then waits.
> Quite a bit more work and essentially does what the case 1 above does.
>
> Dan
>
>
> On Thursday 09 October 2008 10:27:42 am Ronald Pieterse wrote:
>> Hello.
>>
>> In my service doing some time consuming stuff (reading email and handling
>> them) thus the connection is timing-out before I can start sending the
>> response. What way would I need to walk to keep the connection open? Is
>> there any way CXF can help in this?
>>
>> Thnx,
>> Ronald
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>
>
--
View this message in context: http://www.nabble.com/How-to-handle-a-large-response-object-or-attachment-with-CXF--tp19900120p19932789.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle a large response object or attachment with CXF?
Posted by Daniel Kulp <dk...@apache.org>.
Couple options:
1) Use a WS-Addressing decoupled endpoint for the response. The server would
then basically send it back on a decoupled channel when it's ready.
2) Increase the timeout on the client side. We default it to 60 seconds, but
it's easily configured (or even turned off).
3) Use a more "callback" pattern where the client creates an endpoint to get
the response, sends the endpoint reference with the request, then waits.
Quite a bit more work and essentially does what the case 1 above does.
Dan
On Thursday 09 October 2008 10:27:42 am Ronald Pieterse wrote:
> Hello.
>
> In my service doing some time consuming stuff (reading email and handling
> them) thus the connection is timing-out before I can start sending the
> response. What way would I need to walk to keep the connection open? Is
> there any way CXF can help in this?
>
> Thnx,
> Ronald
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: How to handle a large response object or attachment with CXF?
Posted by Andrew Clegg <an...@gmail.com>.
2008/10/9 Ronald Pieterse <ro...@gmail.com>:
>
> In my service doing some time consuming stuff (reading email and handling
> them) thus the connection is timing-out before I can start sending the
> response. What way would I need to walk to keep the connection open? Is
> there any way CXF can help in this?
You could try doing it asynchronously with a submit/monitor/retrieve model:
http://www.jroller.com/gmazza/date/20080308
However this is a fair amount of extra coding. If you do figure out a
way of handling lengthy requests synchronously, let us know, as I am
starting to approach response sizes where this will be an issue...
Andrew.