You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "amine.elamraoui" <el...@gmail.com> on 2013/09/27 18:42:09 UTC

Camel netty issue when receiving response

Hi,

I'm new in camel approach, I route a message from a file to a netty
producer, then the response from the server is routed to another file ( the
response message is composed of lines )

from("file:C:\\request?noop=true")
                .convertBodyTo(String.class)
                .setExchangePattern(ExchangePattern.InOut)
                .setHeader(NettyConstants.NETTY_CLOSE_CHANNEL_WHEN_COMPLETE,
constant(false))
                .to("log:Socket response??showAll=true&multiline=true")
               
.to("netty:tcp://195.95.167.35:2037?textline=true&synchronous=true&ssl=true&sslContextParameters=#sslConf&sync=true&disconnect=true")
                .to("file:C:\\PM\\Certificate\\response\\");

But when i checked the output file , i discover that it dispatch only the
first line of the stream 
i guess it has something with the delimiter flag

thanks in advance 




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-netty-issue-when-receiving-response-tp5740306.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel netty issue when receiving response

Posted by "amine.elamraoui" <el...@gmail.com>.
When a producer send a message ( with inout exchange pattern ) ,who will take
the response ? the same producer or a consumer ?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-netty-issue-when-receiving-response-tp5740306p5740388.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel netty issue when receiving response

Posted by Claus Ibsen <cl...@gmail.com>.
Yes

lørdag den 28. september 2013 skrev amine.elamraoui :

> Thanks for your reply
>
> The problem is not in sending but when receiving ; i suppose it uses the
> same codec in both cases !!!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-netty-issue-when-receiving-response-tp5740306p5740373.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel netty issue when receiving response

Posted by "amine.elamraoui" <el...@gmail.com>.
Thanks for your reply 

The problem is not in sending but when receiving ; i suppose it uses the
same codec in both cases !!!  



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-netty-issue-when-receiving-response-tp5740306p5740373.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel netty issue when receiving response

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

The textline codec is only one line of text, eg until the newline
character. If you want to send more data, then you need to use a
custom codec or some way to tell netty when the data ends.

On Fri, Sep 27, 2013 at 6:42 PM, amine.elamraoui
<el...@gmail.com> wrote:
> Hi,
>
> I'm new in camel approach, I route a message from a file to a netty
> producer, then the response from the server is routed to another file ( the
> response message is composed of lines )
>
> from("file:C:\\request?noop=true")
>                 .convertBodyTo(String.class)
>                 .setExchangePattern(ExchangePattern.InOut)
>                 .setHeader(NettyConstants.NETTY_CLOSE_CHANNEL_WHEN_COMPLETE,
> constant(false))
>                 .to("log:Socket response??showAll=true&multiline=true")
>
> .to("netty:tcp://195.95.167.35:2037?textline=true&synchronous=true&ssl=true&sslContextParameters=#sslConf&sync=true&disconnect=true")
>                 .to("file:C:\\PM\\Certificate\\response\\");
>
> But when i checked the output file , i discover that it dispatch only the
> first line of the stream
> i guess it has something with the delimiter flag
>
> thanks in advance
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-netty-issue-when-receiving-response-tp5740306.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen