You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Oliver Pfeiffer (JIRA)" <ji...@apache.org> on 2016/08/18 08:13:20 UTC

[jira] [Comment Edited] (CAMEL-1077) tcp client mode / server mode determined by "to" or "from" elements limits usability.

    [ https://issues.apache.org/jira/browse/CAMEL-1077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426072#comment-15426072 ] 

Oliver Pfeiffer edited comment on CAMEL-1077 at 8/18/16 8:12 AM:
-----------------------------------------------------------------

Yes, but in our case we have an OutIn pattern, since *we* have to provide the request message to the client that connects to *our* server-socket. Unfortunately we can not directly open a socket to the other system due to firewall restrictions. Thus the other party needs to poll *our* requests from *our* server-socket that is opened on our system and send the answer back through this socket.

I already tried this simplified example which handles the request file inside the processor. But unfortunately the incoming connection on our server-socket (without sending anything) does not trigger the OutIn route. 

{code}
<route id="polling-data-request-example">
    <from uri="netty4:tcp://0.0.0.0:11111?sync=false&textline=true&decoderMaxLineLength=8192"/>
    <setExchangePattern pattern="OutIn"/>
    <to uri="bean:requestProcessor"/>
</route>
{code}



was (Author: mythos):
Yes, but in our case we have an OutIn pattern, since *we* have to provide the request message to the client that connects to *our* server-socket. Unfortunately we can not directly open a socket to the other system due to firewall restrictions. Thus the other party needs to poll *our* requests from *our* server-socket that is opened on our system and send the answer back through this socket.

I already tried this simplified example which handles the request file inside the processor. But unfortunately the incoming connection on our server-socket (without sending anything) does not trigger the OutIn route. 

{code}
<route id="route-adapter-dlr-ais-all-ships">
    <from uri="netty4:tcp://0.0.0.0:11111?sync=false&textline=true&decoderMaxLineLength=8192"/>
    <setExchangePattern pattern="OutIn"/>
    <to uri="bean:inputProcessor"/>
</route>
{code}


> tcp client mode / server mode determined by "to" or "from" elements limits usability.
> -------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1077
>                 URL: https://issues.apache.org/jira/browse/CAMEL-1077
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-mina
>    Affects Versions: 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0
>            Reporter: Jeff Vienneau
>            Assignee: Willem Jiang
>             Fix For: 2.15.0
>
>
> Internally, 
> MinaProducer is coded to create a Mina connector (client mode socket).
> MinaConsumer is coded to create a Mina acceptor (server mode socket).
> Additionally, it appears a producer (client mode socket) is created for a "to" route mapping and a consumer (server mode socket) is created for a "from" route mapping.
> This means an endpoint cannot be created in which the session is initiated by a client and messages are routed "to" the client. 
> The opposite is also true, an endpoint with a "from" route mapping cannot establish a connection to a tcp server.
> This is a major limitation, as we do not often have control over the systems with which we are interfacing.
> Perhaps, the mina::tcp URI could have a parameter the sets the socket mode: tcp.mode=server or tcp.mode=client.
> Hope this make sense, thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)