You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Taariq Levack <ta...@gmail.com> on 2011/07/27 18:06:34 UTC

camel-netty and camel-mina refuse connections unless IP is specified

Hi

This is possibly by design either by camel or by netty/mina, since the
behaviour is consistent between these similar components.

Neither netty nor mina accept connections from remote network locations.
The code works on my machine, but from outside I get 'Connection refused'.

If I use a plain old java SocketServer, or even run Tomcat on the same
port, then I can connect.

While this won't work...
from("mina:tcp://localhost:5130")

...if I specify the IP address instead of localhost then it works fine
from everywhere.

This proves that there is no firewall or other network problem
preventing the client from connecting, the same client works when the
server binds to a specific IP address.

But I didn't expect to need to know the IP for a consumer, we don't
have to do this for http-based components, and I thought it should
consume wherever it runs like SocketServer does where you only provide
the port.

Its so close to production now that I will document it to work this
way and of course pass the IP from the props file and make sure the
server uses a static IP.

Just wondering if this how stuff works.

Taariq

Re: camel-netty and camel-mina refuse connections unless IP is specified

Posted by Taariq Levack <ta...@gmail.com>.
Ah, that works great, thanks Claus.

There's no warning though, I'll take a look why not, doesn't seem to
be my logging config.

Thanks again.

Taariq

On Wed, Jul 27, 2011 at 7:00 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> You should use 0.0.0.0 instead of localhost. I think they even log a
> WARN about this.
>
>
> On Wed, Jul 27, 2011 at 6:06 PM, Taariq Levack <ta...@gmail.com> wrote:
>> Hi
>>
>> This is possibly by design either by camel or by netty/mina, since the
>> behaviour is consistent between these similar components.
>>
>> Neither netty nor mina accept connections from remote network locations.
>> The code works on my machine, but from outside I get 'Connection refused'.
>>
>> If I use a plain old java SocketServer, or even run Tomcat on the same
>> port, then I can connect.
>>
>> While this won't work...
>> from("mina:tcp://localhost:5130")
>>
>> ...if I specify the IP address instead of localhost then it works fine
>> from everywhere.
>>
>> This proves that there is no firewall or other network problem
>> preventing the client from connecting, the same client works when the
>> server binds to a specific IP address.
>>
>> But I didn't expect to need to know the IP for a consumer, we don't
>> have to do this for http-based components, and I thought it should
>> consume wherever it runs like SocketServer does where you only provide
>> the port.
>>
>> Its so close to production now that I will document it to work this
>> way and of course pass the IP from the props file and make sure the
>> server uses a static IP.
>>
>> Just wondering if this how stuff works.
>>
>> Taariq
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Re: camel-netty and camel-mina refuse connections unless IP is specified

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

You should use 0.0.0.0 instead of localhost. I think they even log a
WARN about this.


On Wed, Jul 27, 2011 at 6:06 PM, Taariq Levack <ta...@gmail.com> wrote:
> Hi
>
> This is possibly by design either by camel or by netty/mina, since the
> behaviour is consistent between these similar components.
>
> Neither netty nor mina accept connections from remote network locations.
> The code works on my machine, but from outside I get 'Connection refused'.
>
> If I use a plain old java SocketServer, or even run Tomcat on the same
> port, then I can connect.
>
> While this won't work...
> from("mina:tcp://localhost:5130")
>
> ...if I specify the IP address instead of localhost then it works fine
> from everywhere.
>
> This proves that there is no firewall or other network problem
> preventing the client from connecting, the same client works when the
> server binds to a specific IP address.
>
> But I didn't expect to need to know the IP for a consumer, we don't
> have to do this for http-based components, and I thought it should
> consume wherever it runs like SocketServer does where you only provide
> the port.
>
> Its so close to production now that I will document it to work this
> way and of course pass the IP from the props file and make sure the
> server uses a static IP.
>
> Just wondering if this how stuff works.
>
> Taariq
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/