[rabbitmq-discuss] Unable remotely connect to an Rabbitmq server?

sam_mis sameek at arosys.com
Mon Sep 19 13:40:18 BST 2011


Hi

I have install Rabbitmq server on Debian machine. I want to connect this
machine and publish message on it.other machine will connect with the Debian
and consume those messages.i am using following code:

      factory = new ConnectionFactory();
      logger.info("successfully opening a Connection to an AMQP broker..");
      factory.setUsername("guest");
      logger.info("Set the user name...");
      factory.setPassword("guest");
      logger.info("Set the password...");
      factory.setVirtualHost("/");
      logger.info("Set the virtual host...");
      factory.setHost("192.168.1.2");  //my Debian server IP Address
      logger.info("The default host to use for connections..");
      factory.setPort(5672);
      logger.info("Set the target port..");
      connection = factory.newConnection();

when i tried i got the following error:

java.net.ConnectException: Connection timed out: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:529)
	at java.net.Socket.connect(Socket.java:478)
	at
com.rabbitmq.client.ConnectionFactory.createFrameHandler(ConnectionFactory.java:342)
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:380)
	at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:403)
	at RabbitMQProducer12.producer(RabbitMQProducer12.java:43)
	at RabbitMQProducer12.main(RabbitMQProducer12.java:78)

I want to know where the problem.Is this procedure is correct to connect
remotely to the other system.if it is wrong then what will be the correct
way to do this? 
-- 
View this message in context: http://old.nabble.com/Unable--remotely-connect-to-an-Rabbitmq-server--tp32494635p32494635.html
Sent from the RabbitMQ mailing list archive at Nabble.com.



More information about the rabbitmq-discuss mailing list