[rabbitmq-discuss] socket error while using rabbitmq and a NAT (Network address translation)
Emile Joubert
emile at rabbitmq.com
Wed Mar 2 11:01:07 GMT 2011
Hi,
It is very strange to see an AMQP connection work perfectly via the
tracer but fail without it.
(Does the broker listen on the same port in both cases? If not, does the
underlying network treat both ports the same?)
Can you replicate these results with any of the built-in Java examples
that are provided with RabbitMQ? I would suggest using the MulticastMain
tool with and without the Tracer. This will eliminate the possibility of
AMQP protocol errors causing the problem.
> DataInputStream.readUnsignedByte()
This is not the cause of the problem. It probably just means that the
underlying connection has been forcefully closed.
> It happens only from certain computers.
Do these computers have anything in common with each other that they do
not have in common with the computers that don't produce errors?
-Emile
On 02/03/11 09:41, mysurf mail wrote:
>
> We debugged the tracer and saw that it uses java.net.socket. The
> connection was ok through the tracer.
> Now, we closed the tracer and connected directly to the rabbit.
> We attached the source and debugged factory.newconnmection() we saw the
> exception occured in DataInputStream.readUnsignedByte() . (it throws an
> EOFException when ch<0) .
> any ideas?
>
> On Wed, Mar 2, 2011 at 9:41 AM, mysurf mail <stammailbox at gmail.com
> <mailto:stammailbox at gmail.com>> wrote:
>
> Flash News :
> I am sorry to bother you a lot this morning . But I have an
> interesting finding
> When I activate my client with the tracer - it connects well to the
> rabbitmq server .
> when I connect directly - it throws that exception .
>
> So maybe my problem is with the connection string ?
> here it is - I only replace the ip and port
> BasicChannel(Username, Password, VirtualHost, BrokerIp, BrokerPort,
> Heartbeat);
> BasicChannel(Username, Password, VirtualHost, "127.0.0.1",5672,
> Heartbeat);
>
> and my ctor is
>
> public BasicChannel(final String username, final String password, final String virtualHost, final String brokerIp, final int brokerPort, int heartbeat) {
> ConnectionFactory factory = new ConnectionFactory();
> factory.setUsername(username);
> factory.setPassword(password);
> factory.setVirtualHost(virtualHost);
> factory.setRequestedHeartbeat(heartbeat);
> factory.setHost(brokerIp);
> factory.setPort(brokerPort);
>
> connection = null;
> try {
> connection = factory.newConnection();
> } catch (IOException e) {
> throw new PlatformException("could not create connection", e);
> }
>
>
>
> Thanks
More information about the rabbitmq-discuss
mailing list