cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Mouawad <pmoua...@apache.org>
Subject Fwd: What is the proper way of setting client Timeout per Webservice method ?
Date Fri, 07 Jun 2013 22:03:03 GMT
The right one

---------- Forwarded message ----------
From: *Daniel Kulp*
Date: Wednesday, May 8, 2013
Subject: What is the proper way of setting client Timeout per Webservice
method ?
To: Philippe Mouawad <pmouawad@apache.org>



On May 8, 2013, at 1:40 AM, Philippe Mouawad
<pmouawad@apache.org<javascript:_e({}, 'cvml',
'pmouawad@apache.org');>>
wrote:

Hello Daniel,
Thanks for this.
Regarding mu question on timeout I wanted to know if I was issing something
in your proposed solution as it does not work to have different timeouts
for 2 operations.


It would need to be specifically set on the request context prior to each
call.  Thus, not something that is "automatic" depending on the operation.
  At this point, the interceptor is likely the only option for handling it
automatically.

Regardinh ICLA I have already signed one for JMeter project, do I need one
for CXF ? Where are the docs located in subversion ?


It's not in subversion.   We use confluence:

https://cwiki.apache.org/confluence/display/CXF/Index
https://cwiki.apache.org/confluence/display/CXF20DOC/Index


If you create an account in confluence and send me the ID, I'll add you to
the group that is marked as having submitted an ICLA and you can edit away.
  I *THINK* you have an id of:
p.mouawad@ubik-ingenierie.com<https://cwiki.apache.org/confluence/admin/users/viewuser.action?username=p.mouawad@ubik-ingenierie.com>

as that looks like you, but I want to confirm first.


Dan



Thanks
Regards
Philippe

On Wednesday, May 8, 2013, Daniel Kulp wrote:


On May 7, 2013, at 10:14 AM, Philippe Mouawad <pmouawad@apache.org> wrote:

> Hello,
> Any update on this ?
>
> If we want to contribute some docs patches, what is the way for it ? I
> don't see docs in source code of project. I've read this
> http://cxf.apache.org/getting-involved.html.

You would need to submit an ICLA to apache.  See:
http://www.apache.org/dev/new-committers-guide.html#cla

Once that is submitted and processed, we can actually grant your account in
confluence to have write access and you can make any doc updates you
need/want.


>
>
> Thanks
> Regards
> Philippe
>
> On Mon, May 6, 2013 at 6:53 PM, Philippe Mouawad <pmouawad@apache.org
>wrote:
>
>> Thanks Daniel,
>> That fixes the concurrent access but In my understanding and tests it
does
>> not allow setting a different timeout depending on method, right ?
>> Maybe I am not clear enought, here is the call sequence I have where I
>> want a timeout of 3 secondes for getCustomersByName and default one for
>> getCustomersById:
>>
>> CustomerService service = getService();
>>        long t = System.currentTimeMillis();
>>        System.out.println("Start time-->" + t);
>>        try {
>>            HTTPClientPolicy policy = new HTTPClientPolicy();
>>            policy.setReceiveTimeout(3000);
>>
>>
((BindingProvider)service).getRequestContext().put("thread.local.request.context",
>> "true");
>>
>>
((BindingProvider)service).getRequestContext().put(HTTPClientPolicy.class.getName(),
>> policy);
>> // Dirty code for demo
>>            System.out.println(service.getCustomersByName("timeout"));
>>        } catch (Exception e) {
>> // Dirty code for demo
>>            e.printStackTrace();
>>        }
>>        org.apache.cxf.endpoint.Client client =
>> ClientProxy.getClient(service);
>>        HTTPConduit conduit = (HTTPConduit) client.getConduit();
>> // Dirty code for demo
>>        System.out.println(conduit);
>>
>>        service = getService();
>> //  THIS ONE IS IMPACTED BY PREVIOUS SETTING AS IT'S IN SAME THREAD
>>        service.getCustomerById("timeout");
>>
>> Thanks
>>
>>
>> On Mon, May 6, 2013 at 6:32 PM, Daniel Kulp <dkulp@apache.org> wrote:
>>
>>>
>>> On May 6, 2013, at 10:48 AM, Philippe Mouawad <pmouawad@apache.org>
>>> wrote:
>>>
>>>> Hello Daniel
>>>>
>>>> Many thanks for clarifications but what I don't understand is how this
>>> one
>>>> would not impact other methods of Webservice.
>>>> - ((BindingProvider)proxy)
>>>> getRequestContext().put(HTTPClientPolicy.class.getName(), policy);
>>>> I made a little test and it seems the second operation getCustomerById
>>> is
>>>> impacted, which seems to me regular as the service is a Spring Bean. Am
>>> I
>>>> missing something ?
>>>
>>> Oh.. forgot to mention you would have to flip the request context over
to
>>> be threadsafe/threadlocal first:
>>>
>>> From:
>>> http://cxf.apache.org/faq.html#FAQ-AreJAXWSclientproxiesthreadsafe%3F
>>>
>>>
((BindingProvider)proxy).getRequestContext().put("thread.local.request.context",
>>> "true");
>>>
>>> that would then start using a thread local for the context which would
>>> keep the operations separate.
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>>>
>>>> Regards
>>>> Phil


-- 
Daniel Kulp
dkulp@apache.org <javascript:_e({}, 'cvml', 'dkulp@apache.org');> -
http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message