Connecting to remote activemq instance running on docker container

I have 2 docker containers, one running a spring app (in tomcat) and one running an active mq instance. When I try to connect to it from my spring app, I get the following error. Only activeMQ is running on the one container and the port is properly exposed. I verified the IP address of the docker container (shown below) and that is correct.

I’m not sure what could be causing this error at this point. Any thoughts would be appreciated.

  • How to run services on startup in docker container
  • Getting all open connections within a docker image
  • Error logging in docker running nginx, php-fpm
  • Docker build causes vagrant image to lose connection
  • DEIS no public IP's
  • Docker port binding doesn't seem to work
  • ERROR [] Failed to start Apache ActiveMQ ([mybroker, ID:489af431756c-60313-1409695404227-0:1], Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp:// due to: Cannot assign requested address)

  • PHPfpm and Nginx not working in Docker with Supervisord
  • Running Elastic Search with Laradock
  • Files changes not reflected in Docker image after rebuild
  • Why patch linux kernel on Centos for using
  • Docker compose not finding my index.js
  • Play change RUNNING_PID file path
  • One Solution collect form web for “Connecting to remote activemq instance running on docker container”

    You configured Spring to start a broker service on, which is the IP of the remote machine. Instead, you should configure Spring to connect to an existing broker on that machine. From the ActiveMQ documentation and using the Spring facility JMSTemplate:

    <!-- a pooling based JMS provider -->
    <bean id="jmsFactory"
      <property name="connectionFactory">
        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
          <property name="brokerURL">
    <!-- Spring JMS Template -->
    <bean id="myJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
      <property name="connectionFactory">
        <ref local="jmsFactory"/>
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.