cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Connection between client and server in CXF - OSGi
Date Sat, 18 Apr 2015 10:40:37 GMT
The http conduit settings like described here should work. You have to 
check that you use the correct namespace.
THe syntax should be the same though.

http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html

Christian


Am 16.04.2015 um 12:34 schrieb tho huynh ngoc:
> Hi Christian,
>  From your example in
> http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
> Can i configure "session-timeout" property in blueprint.xml ?
> Thank you very much,
> Regards,
> Tho
>
> 2015-04-15 12:00 GMT+02:00 tho huynh ngoc <ngocthobkdn@gmail.com>:
>
>> Hi,
>>
>> We can set the waiting timeout of client with the property "cxf.synchronous.timeout".
>> However, i set the high value of waiting timeout but the client does not
>> receive responses from server
>> For example: waiting timeout of client is 10 minutes. The processing time
>> of server is 5minutes par packet.
>> In this case, the server responds messages to client but the client does
>> not receive them.
>> I think this is the problem of connection timeout between client and
>> server. The session (connection) is not maintained during communication
>> between client and server.
>>
>> Can anyone please help me?
>> Tho,
>>
>>
>> 2015-04-15 9:26 GMT+02:00 Christian Schneider <chris@die-schneider.net>:
>>
>>> I am not sure how to set the timeout to wait for the response in the udp
>>> transport.
>>> As your example is very asynchronous you might think about using two one
>>> way transports anyway.
>>> You can use ws addressing to set the url to send the response to. Or
>>> store it in your service data.
>>>
>>> To use two one way transports would also allow to recover from the client
>>> going down while waiting for a response.
>>>
>>> Christian
>>>
>>>
>>> On 13.04.2015 18:22, tho huynh ngoc wrote:
>>>
>>>>    Hi,
>>>>
>>>> I have a server CXF - OSGi, as delared
>>>>
>>>> Bus bus = BusFactory.*getDefaultBus*();
>>>>
>>>> WorkQueueManager wqm = bus.getExtension(WorkQueueManager.*class*);
>>>>
>>>> AutomaticWorkQueueImpl wq = *new* AutomaticWorkQueueImpl("udp-
>>>> transport");
>>>>
>>>> wq.setHighWaterMark(25); ///number of threads, *min*: 5, max: 2^31-1,
>>>> default: 25
>>>>
>>>> wq.setQueueSize(64); ///queue size, *min*: 1, max: 2^31-1, default:256
>>>>
>>>>        //System.out.println("5th and 1mem");
>>>>
>>>> //any other settings here
>>>>
>>>> wqm.addNamedWorkQueue("udp-transport", wq);
>>>>
>>>> JaxWsServerFactoryBean factory = *new* JaxWsServerFactoryBean();
>>>>
>>>> factory.setAddress("udp://192.168.56.1:9393/print");
>>>>
>>>> factory.setServiceClass(Service.*class*);
>>>>
>>>> factory.setServiceBean(*this*);
>>>>
>>>> factory.getInInterceptors().add(*new* LoggingInInterceptor());
>>>>
>>>> factory.getOutInterceptors().add(*new* LoggingOutInterceptor());
>>>>
>>>> factory.create().start();
>>>>
>>>> I use my two queues to save requests and responses at server side.
>>>>
>>>>    inputList = *new* ConcurrentLinkedQueue<Job>();
>>>>
>>>> returnList = *new* CopyOnWriteArrayList<Job>();
>>>>
>>>> inputList saves requests from clients
>>>>
>>>> returnList saves results of requests.
>>>>
>>>>    When a client sends a message to the server, the server saves this
>>>> message
>>>> into inputList and then looks for results of this message in returnList
>>>> and
>>>> returns it to the client
>>>>
>>>> An independent thread reads inputList and calculate it, then returns
>>>> results to returnList
>>>>
>>>>    Problem: I run 100 clients sending msgs at the same time to server.
>>>> With
>>>> the above configuration, server can receive 91 msgs and RETURNS also
>>>> these
>>>> 91 msgs to client.
>>>>
>>>>    However, there are only 62 clients receiving the returns, although I
>>>> set
>>>> timeout of clients with a high value (the waiting time to receiving the
>>>> results). Clients are configured as follows
>>>>
>>>>    factory = *new* JaxWsProxyFactoryBean();
>>>>
>>>> factory.getInInterceptors().add(*new* LoggingInInterceptor());
>>>>
>>>> factory.getOutInterceptors().add(*new* LoggingOutInterceptor());
>>>>
>>>> factory.setServiceClass(Service.*class*);
>>>>
>>>>    factory.setAddress("udp://192.168.56.1:9393/print");
>>>>
>>>> Map<String, Object> props = *new* HashMap<String,Object>();
>>>>
>>>> props.put("cxf.synchronous.timeout", *new* Integer(3000000));
>>>>
>>>> factory.setProperties(props);
>>>>
>>>> service = (Service) factory.create();
>>>>
>>>> I think this problem is related to connection timeout between client and
>>>> server apart from "cxf.synchronous.timeout" value of a client.
>>>>
>>>>    *Question:*
>>>>
>>>> I can configure the connection timeout at the server or client side,
>>>> can't
>>>> i? How to configure the connection timeout ?
>>>>
>>>> Best regards,
>>>>
>>>>
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>


Mime
View raw message