RabbitMQ和ActiveMQ在同一台机器上运行

abx*_*x78 2 activemq-classic rabbitmq

出于测试目的,我需要在同一台Windows机器上运行ActiveMQ和RabbitMQ.我已经安装了,但我不能一起运行它们:我需要停止一个服务才能运行另一个服务.

这是我试图启动运行ActiveMQ的RabbitMQ的错误:

=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]}}}}}}}}}}
Run Code Online (Sandbox Code Playgroud)

这是我试图在RabbitMQ已经运行的情况下启动ActiveMQ的错误:

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
Run Code Online (Sandbox Code Playgroud)

那个"已经在使用的地址"是我猜的关键.

有什么办法解决这个问题吗?谢谢

Gab*_*ele 9

这是问题所在:java.net.BindException:地址已在使用中:JVM_Bind)

两个代理都使用5672端口(amqp默认端口).

只需更改一个代理的端口,例如在rabbitmq中查看此链接:https://www.rabbitmq.com/configure.html

配置文件rabbitmq.config允许配置RabbitMQ核心应用程序,Erlang服务和RabbitMQ插件.它是标准的Erlang配置文件,记录在Erlang配置手册页上.

示例配置文件如下:

[

     {rabbit, [{tcp_listeners, [5673]}]}   
]. 
Run Code Online (Sandbox Code Playgroud)

这个例子将是RabbitMQ从5672到5673监听的端口.

此配置文件与rabbitmq-env.conf不同,后者可用于在非Windows系统上设置环境变量.