RabbitMQ and ActiveMQ running on the same machine

谁说我不能喝 提交于 2021-01-27 20:45:19

问题


For testing purposes I need ActiveMQ and RabbitMQ running on the same Windows machine. I have both installed, but I can't run them together: I need to stop one service in order to have the other one running.

This is the error I get trying to start RabbitMQ having ActiveMQ running:

=INFO REPORT==== 17-Feb-2015::14:24:00 ===
Error description:
   {could_not_start,rabbit,
    {bad_return,
     {{rabbit,start,[normal,[]]},
      {'EXIT',
       {rabbit,failure_during_boot,
        {boot_step,networking,
         {case_clause,
          {error,
           {{shutdown,
             {failed_to_start_child,tcp_listener,
              {cannot_listen,{0,0,0,0,0,0,0,0},5672,eacces}}},
            {child,undefined,'rabbit_tcp_listener_sup_:::5672',
             {tcp_listener_sup,start_link,
              [{0,0,0,0,0,0,0,0},
               5672,
               [inet6,binary,
                {packet,raw},
                {reuseaddr,true},
                {backlog,128},
                {nodelay,true},
                {linger,{true,0}},
                {exit_on_close,false}],
               {rabbit_networking,tcp_listener_started,[amqp]},
               {rabbit_networking,tcp_listener_stopped,[amqp]},
               {rabbit_networking,start_client,[]},
               "TCP Listener"]},
             transient,infinity,supervisor,
             [tcp_listener_sup]}}}}}}}}}}

And this is the error I get trying to start ActiveMQ with RabbitMQ already running:

jvm 1    |  INFO | Listening for connections at: tcp://BROKER:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
jvm 1    |  INFO | Connector openwire started
jvm 1    | ERROR | Failed to start Apache ActiveMQ ([localhost, ID:DEV-BROKER01-56290-1424197666199-0:1], java.io.IOException: Transport Connector could not be registered in JMX: java.io.IOException: Failed to bind to server socket: amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600 due to: 
                   java.net.BindException: Address already in use: JVM_Bind)
jvm 1    |  INFO | Apache ActiveMQ 5.11.0 (localhost, ID:DEV-BROKER01-56290-1424197666199-0:1) is shutting down

That "Address already in use" is the key I guess.

Any way to sort this out? Thanks


回答1:


this is the problem: java.net.BindException: Address already in use: JVM_Bind)

both the brokers use the 5672 port (amqp default port).

just change the port for one broker, for example in rabbitmq check this link: https://www.rabbitmq.com/configure.html

The configuration file rabbitmq.config allows the RabbitMQ core application, Erlang services and RabbitMQ plugins to be configured. It is a standard Erlang configuration file, documented on the Erlang Config Man Page.

An example configuration file follows:

[

     {rabbit, [{tcp_listeners, [5673]}]}   
]. 

This example will the port RabbitMQ listens on from 5672 to 5673.

This configuration file is not the same as rabbitmq-env.conf, which can be used to set environment variables on non-windows systems.



来源:https://stackoverflow.com/questions/28565527/rabbitmq-and-activemq-running-on-the-same-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!