Results 1 to 10 of 10

Thread: How to connect to Active MQ broker running in another Machine

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    12

    Default How to connect to Active MQ broker running in another Machine

    Hi,
    I am trying to connect to active MQ broker which is running in a remote machine. [the configuration part is below].But i am getting the following error.How can i connect to Active MQ broker running in different machine using spring configurtion.

    java.io.IOException: Failed to bind to server socket: stomp://wendy-test.nyc.e-infoexchange.net:61613 due to: java.net.BindException: Cannot assign requested address: JVM_Bind
    at org.apache.activemq.util.IOExceptionSupport.create (IOExceptionSupport.java:31)
    at org.apache.activemq.transport.tcp.TcpTransportServ er.bind(TcpTransportServer.java:88)
    at org.apache.activemq.transport.tcp.TcpTransportFact ory.doBind(TcpTransportFactory.java:56)


    <amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
    <amq:transportConnector uri="stomp://remoteIP:61613" />
    </amq:transportConnectors>
    </amq:broker>
    <bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFa ctory">
    <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQConnectionFacto ry" >
    <property name="brokerURL">
    <value>vm://remoeIP:61613</value>
    </property>
    </bean>
    </property>
    </bean>

  2. #2
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Your config does NOT indicate that you are trying to connect to a remote JMS server; it indicates that you are trying to HOST a JMS broker, which is why you are getting a 'server bind exception'. You cannot bind a REMOTE address for a server socket.

  3. #3
    Join Date
    Jun 2008
    Posts
    12

    Default

    Thanks for ur reply. Normally i used vm://localhost in brokerURL of ActiveMQConnectionFactory bean. It was working fine. But when i try to connect to active MQ broker running in other machine, i am getting JVM binding error.Can plz explain me how can i configure spring to solve my requirement?.

  4. #4
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    It's not a spring problem, it's an active mq configuration problem.

    I'd suggest that you RTFM....

    You are trying to create a CLIENT connection to a remote BROKER.

    http://activemq.apache.org/spring-support.html

  5. #5
    Join Date
    Jun 2008
    Posts
    12

    Default

    Thanks for ur reply. The link is really useful. I modified my configuration as below. Do i need to specify anything else for stomp: transport?.

    <amq:broker useJmx="false" persistent="false">
    <amq:transportConnectors>
    <amq:transportConnector uri="tcp://localhost:0" />
    </amq:transportConnectors>
    </amq:broker>

    <!-- a pooling based JMS provider -->
    <bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFa ctory">
    <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQConnectionFacto ry" >
    <property name="brokerURL">
    <value>stomp://BrokermachineIP:61613</value>
    </property>
    </bean>
    </property>
    </bean>

  6. #6
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    If you are connecting to a remote mq broker, you don't need to run one on your local machine. You should NOT have an amq:broker bean defined. Just the JMS connection factory bean that connects to the remote broker.

Posting Permissions

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