Hi,

No, two servers are in two separate JVMs. In my case, i can not use
CXFServlet.

Regards,
Tho.


2016-01-18 12:12 GMT+01:00 Sergey Beryozkin <[email protected]>:

> Hi
>
> Are these two servers collocated ? If yes then the simpler option may be
> to use a local transport to send a message from Server1 to Server2
>
> Another option to try is to configure CXFServlet to use
> RequestDispatcherProvider to delegate the processing to some other servlet
> (assuming the servers are collocated)
>
> Cheers, Sergey
> On 18/01/16 10:34, tho huynh ngoc wrote:
>
>> Hi,
>>
>>
>> I see a difficult problem when I transfer a message between two CXF
>> Destinations.
>>
>>
>> My implementation is described as follows:
>>
>> A client sends a message to Server 1. However, I don't want to process
>> this
>> message at Server1. Thus, I catch this message at Destination of Server 1
>> and transfer it to Destination of Server 2 that processes the message and
>> responds to the client.
>>
>> At Destination of Server 2, Destination receives two informations of the
>> message: NioDatagramSession and Soaf message in a sequence of bytes.
>>
>>
>> NioDatagramSession niosession;
>>
>> *byte*[] soafmessage;
>>
>>
>> In order to server 2 that processes the message from the client, I
>> declared
>> as follows:
>>
>>
>> *final* MessageImpl m = *new* MessageImpl();
>>
>> Exchange exchange = *new* ExchangeImpl();
>>
>> exchange.setDestination(MyDestination.*this*);
>>
>> m.setDestination(MyDestination.*this*);
>>
>> exchange.setInMessage(m);
>>
>>
>>
>> IoBuffer ioBuffer = IoBuffer.*allocate*(256);
>>
>> ioBuffer.setAutoExpand(*true*);
>>
>> ioBuffer.mark();
>>
>> ioBuffer.put(soafmessage);
>>
>> ioBuffer.reset();
>>
>> IoSessionInputStream ioses = *new* IoSessionInputStream();
>>
>> ioses.setBuffer(ioBuffer);
>>
>> InputStream in = ioses;
>>
>> m.setContent(InputStream.*class*, in);
>>
>>
>> IoSession session = (IoSession)niosession; //new
>>
>> SocketAddress remoteAddress = session.getRemoteAddress();
>>
>> SocketAddress localAddress = isa; //address of server 2
>>
>>
>> IoSession newsession = acceptor.newSession(remoteAddress, localAddress);
>>
>> OutputStream out = *new* IoSessionOutputStream(newsession);
>>
>>
>> out = *new* UDPDestinationOutputStream(out);
>>
>> m.put(UDPConnectionInfo.*class*, *new* UDPConnectionInfo(newsession,
>> out,in
>> ));
>>
>> getMessageObserver().onMessage(m);
>>
>>
>> To here, when I call the command: getMessageObserver().onMessage(m); the
>> implementation service of server 2 will process the message and return to
>> its BackChanelConduit but THE RESPONSE MESSAGE CAN NOT ARRIVE AT CLIENT.
>>
>>
>> There are not the exceptions during execution.
>>
>>
>> I can not use the routing service and also other service in my case.
>>
>> Could you please give me a suggestion why there are not exception but the
>> client can't receive the response from server 2?
>>
>>
>> Thank you so much.
>>
>> Regards.
>>
>> Tho.
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>

Reply via email to