Results 1 to 4 of 4

Thread: When using RabbitMQ service and Insight get "connection refused"

  1. #1

    Default When using RabbitMQ service and Insight get "connection refused"

    I have a simple rabbitMQ service up and running in an application. When I enable Insight for the application and restart the application I will recieve a connection refused. Disabling Insight and restarting the application will allow normal use again.

    Here is the relevant context snippet:

    Code:
    <!-- Obtain a connection to the RabbitMQ via cloudfoundry-runtime: -->
        <rabbit:connection-factory id="rabbitConnectionFactory" />
    
        <!-- Set up the AmqpTemplate/RabbitTemplate: -->
        <rabbit:template connection-factory="rabbitConnectionFactory"/>
    
        <!-- Request that queues, exchanges and bindings be automatically
             declared on the broker: -->
        <rabbit:admin connection-factory="rabbitConnectionFactory"/>
    
        <!-- Declare the "messages" queue: -->
        <rabbit:queue name="messages" durable="true"/>
    Is there a way to name the service in the context? I know that the service name is "rabbitmq" when I bound it to the application. As a note this is deployed to cloud foundry

  2. #2
    Join Date
    Jan 2012
    Posts
    12

    Default

    Hi,
    Can you please attach the logs?

    Thanks,
    Tal

  3. #3

    Default

    Sure thing

    Code:
    DEBUG: org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolving exception from handler [public java.lang.String org.springframework.samples.mvc.simple.RabbitController.torrentStatusSub(org.springframework.ui.Model)]: org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused
    DEBUG: org.springframework.web.servlet.DispatcherServlet - Could not complete request
    org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused
    	at org.springframework.amqp.rabbit.connection.RabbitUtils.convertRabbitAccessException(RabbitUtils.java:106)
    	at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:118)
    	at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:179)
    	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$1.createConnection(ConnectionFactoryUtils.java:77)
    	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:121)
    	at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:67)
    	at org.springframework.amqp.rabbit.connection.RabbitAccessor.getTransactionalResourceHolder(RabbitAccessor.java:100)
    	at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:324)
    	at org.springframework.amqp.rabbit.core.RabbitTemplate.receive(RabbitTemplate.java:204)
    	at org.springframework.amqp.rabbit.core.RabbitTemplate.receiveAndConvert(RabbitTemplate.java:233)
    	at org.springframework.samples.mvc.simple.RabbitController.torrentStatusSub(RabbitController.java:73)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
    	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
    	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
    	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    	at org.apache.catalina.core.StandardContextValve.invoke_aroundBody0(StandardContextValve.java:191)
    	at org.apache.catalina.core.StandardContextValve$AjcClosure1.run(StandardContextValve.java:1)
    	at com.springsource.insight.bootstrap.generic.request.AbstractHttpRequestOperationCollectionAspect.ajc$around$com_springsource_insight_bootstrap_generic_request_AbstractHttpRequestOperationCollectionAspect$1$4edf718fproceed(AbstractHttpRequestOperationCollectionAspect.aj:1)
    	at com.springsource.insight.bootstrap.generic.request.AbstractHttpRequestOperationCollectionAspect.ajc$around$com_springsource_insight_bootstrap_generic_request_AbstractHttpRequestOperationCollectionAspect$1$4edf718f(AbstractHttpRequestOperationCollectionAspect.aj:91)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:118)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    	at java.lang.Thread.run(Thread.java:662)
    Caused by: java.net.ConnectException: Connection refused
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    	at java.net.Socket.connect(Socket.java:529)
    	at com.rabbitmq.client.ConnectionFactory.createFrameHandler(ConnectionFactory.java:362)
    	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:400)
    	at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:423)
    	at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:116)
    	... 41 more
    DEBUG: org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'appServlet' processing GET request for [/torrentSub]
    DEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Looking up handler method for path /torrentSub

  4. #4
    Join Date
    Jan 2012
    Posts
    12

    Default

    We have some issues with rabbit application on cloud foundry because of a collision between the rabbit definitions of the application and the definitions our agent uses to communicate with the insight application (dashboard).
    We will probably fix this in the next release but for now you best option is to create your own connection factory and not rely on cloud foundry to provide one for you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •