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

Oliver Pfeiffer commented on CAMEL-1077:
----------------------------------------

We have to retrieve data from an external system that is not directly reachable 
from our network due to some firewall restrictions. But the other way round 
works pretty fine (other system opens a socket to our system). 

Thus we want to provide a server-socket on our system that allows the other 
system to frequently poll the requests. Unfortunately I haven't had success in 
establishing a server-socket by using the <to...> phrase at all.

Since this seems to be related to client / server and consumer / producer mode 
I would highly appreciate if someone may give us some hints. :-)

Here is an example which requires the XML requests to put into a folder just 
for testual purposes. But the given <to...> phrase always tries to establish a 
client connection, no matter how I set the clientMode option.

{code:xml}
<route id="polling-data-request-example">
    <from uri="file:/tmp/requests/"/>
    <setExchangePattern pattern="OutIn"/>
    <to 
uri="netty4:tcp://0.0.0.0:11111?sync=true&amp;textline=true&amp;decoderMaxLineLength=8192&amp;clientMode=true"/>
    <to uri="bean:requestProcessor"/>
</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)

Reply via email to