You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brett Humphreys <br...@google.com> on 2014/01/22 15:29:45 UTC
Async SOAP & Thread Safety
Hi all,
I'm using CXF 2.2.7. I can't seem to find this in the archive so I thought
I'd ask 2 questions related to Async SOAP calls and thread safety:
1. At what point is it safe to re-use a proxy when using async soap?
Can I re-use a proxy after I've made the async request or do I need to
wait until the AsyncHandler has been called back with a Result before using
that proxy again?
2. Speaking of proxies, I'm particularly fond of calling destroy on the
client once I'm done with it. We've experienced memory leaks in the past
without making this call. Here again, if I make this call after I've made
the async request but before I get called back on the AsyncHandler will
that cause me problems or will this destroy call only clean itself up once
all outstanding calls have been finished?
Thanks!
Brett
--
Brett Humphreys | Software Engineer, Carrier Billing Technical Lead |
bretthumphreys@google.com | 720-235-1020
Re: Async SOAP & Thread Safety
Posted by Brett Humphreys <br...@google.com>.
Thanks Dan. Upgrading is certainly on our roadmap, however, it is, well,
complicated :)
On Wed, Jan 22, 2014 at 7:33 AM, Daniel Kulp <dk...@apache.org> wrote:
>
> On Jan 22, 2014, at 9:29 AM, Brett Humphreys <br...@google.com>
> wrote:
>
> > Hi all,
> > I'm using CXF 2.2.7. I can't seem to find this in the archive so I
> thought
> > I'd ask 2 questions related to Async SOAP calls and thread safety:
>
> With that ancient version of CXF, I’m not really sure on any of the
> answers. You’re kind of on your own with it. I STRONGLY suggest upgrading.
>
> > 1. At what point is it safe to re-use a proxy when using async soap?
> > Can I re-use a proxy after I've made the async request or do I need to
> > wait until the AsyncHandler has been called back with a Result before
> using
> > that proxy again?
>
> With recent versions of CXF, you should be able to make 100’s of calls
> with the proxy just fine. However, the default thread pool used to “wait”
> on them would only have 25 threads. The newer async transport can allow
> thousands of outstanding requests.
>
>
> > 2. Speaking of proxies, I'm particularly fond of calling destroy on the
> > client once I'm done with it. We've experienced memory leaks in the
> past
> > without making this call. Here again, if I make this call after I've
> made
> > the async request but before I get called back on the AsyncHandler will
> > that cause me problems or will this destroy call only clean itself up
> once
> > all outstanding calls have been finished?
>
> I believe with that ancient of a version of CXF, calling destroy with an
> outstanding request would cause problems. Not sure. For modern versions
> of CXF, a ((Closeable)proxy).close() call should be OK, I think.
>
> Dan
>
>
>
> >
> > Thanks!
> >
> > Brett
> >
> >
> >
> > --
> >
> > Brett Humphreys | Software Engineer, Carrier Billing Technical Lead |
> > bretthumphreys@google.com | 720-235-1020
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>
>
--
Brett Humphreys | Software Engineer, Carrier Billing Technical Lead |
bretthumphreys@google.com | 720-235-1020
Re: Async SOAP & Thread Safety
Posted by Daniel Kulp <dk...@apache.org>.
On Jan 22, 2014, at 9:29 AM, Brett Humphreys <br...@google.com> wrote:
> Hi all,
> I'm using CXF 2.2.7. I can't seem to find this in the archive so I thought
> I'd ask 2 questions related to Async SOAP calls and thread safety:
With that ancient version of CXF, I’m not really sure on any of the answers. You’re kind of on your own with it. I STRONGLY suggest upgrading.
> 1. At what point is it safe to re-use a proxy when using async soap?
> Can I re-use a proxy after I've made the async request or do I need to
> wait until the AsyncHandler has been called back with a Result before using
> that proxy again?
With recent versions of CXF, you should be able to make 100’s of calls with the proxy just fine. However, the default thread pool used to “wait” on them would only have 25 threads. The newer async transport can allow thousands of outstanding requests.
> 2. Speaking of proxies, I'm particularly fond of calling destroy on the
> client once I'm done with it. We've experienced memory leaks in the past
> without making this call. Here again, if I make this call after I've made
> the async request but before I get called back on the AsyncHandler will
> that cause me problems or will this destroy call only clean itself up once
> all outstanding calls have been finished?
I believe with that ancient of a version of CXF, calling destroy with an outstanding request would cause problems. Not sure. For modern versions of CXF, a ((Closeable)proxy).close() call should be OK, I think.
Dan
>
> Thanks!
>
> Brett
>
>
>
> --
>
> Brett Humphreys | Software Engineer, Carrier Billing Technical Lead |
> bretthumphreys@google.com | 720-235-1020
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com