Hey guys this is a totally bizarre problem but I'm at my wits end trying to debug it so I thought I'd see if anyone has seen this issue. Basically I have connected to my RabbitMQ instance in many cases but always using the Rabbit Java client directly. That has worked fine but now I want to integrate some of this functionality into a Spring app so I'd like to use the Spring-amqp abstractions.
The problem is that for some reason every time I try to connect using the Spring-amqp stuff I get a 'Connection Refused' error. I have used the debugger to inspect what is happening when I try to connect with and without Spring and as far as I can tell there is absolutely no difference. I have drilled all the way down to the socket code in java.net.PlainSocketImpl where there is a call like:
And in both cases that call looks exactly the same but when going through Spring it fails. I'm sure I'm overthinking this and it is something simple. For the record my bean setup looks like:
socketConnect(address, port, timeout);
I would love any ideas. I'm about to start digging into my outbound network traffic because there is obviously SOMETHING different about the two connection requests.
<bean id="rabbitConnectionFactory" class="com.rabbitmq.client.ConnectionFactory">
<property name="username" value="user"/>
<property name="password" value="pass"/>
<property name="virtualHost" value="/vhost" />
<property name="port" value="5627" />
<property name="host" value="22.214.171.124" />
<bean id="connectionFactory" class="org.springframework.amqp.rabbit.connection.SingleConnectionFactory">
<property name="queueName" value="someQueue" />
<property name="connectionFactory" ref="connectionFactory"/>
<property name="messageListener" ref="listener" />