Java 如何更改 Activemq 的默认端口号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18082404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:16:42  来源:igfitidea点击:

How can I change default port number of Activemq

javaapachejmsactivemqjava-ee-7

提问by Hanumath

I am using Windows 7OS. I downloaded apache-activemq-5.8.0.zipfrom these Linkand extracted in C:\Users\Infratab Bangalore\Desktop\Queueing\apache-activemq-5.8.0directory.

我正在使用Windows 7操作系统。我apache-activemq-5.8.0.zip从这些链接下载并解压到C:\Users\Infratab Bangalore\Desktop\Queueing\apache-activemq-5.8.0目录中。

While Activemqinitialization time I read Pre-Installation Requirementsconcept from these Link.

Activemq初始化时,我Pre-Installation Requirements从这些Link 中读取了概念。

I already installed apache-maven-3.0.5in my system.For my conformation I run the following command in my system.

我已经安装apache-maven-3.0.5在我的系统中。对于我的配置,我在我的系统中运行以下命令。

   mvn -version

I am getting the following message,So Mavenis installed successfully.

我收到以下消息,所以Maven安装成功。

 Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:
 28+0530)
 Maven home: P:\Software\apache-maven-3.0.5
 Java version: 1.7.0_21, vendor: Oracle Corporation
 Java home: C:\Program Files\Java\jdk1.7.0_21\jre
 Default locale: en_US, platform encoding: Cp1252
 OS name: "windows 7", version: "6.1", arch: "x86", family: "windows" 

I downloaded geronimo-spec-corba-1.0.jarfrom these Linkand set classpth.

geronimo-spec-corba-1.0.jar从这些链接下载并设置了classpth.

enter image description here

在此处输入图片说明

I started Activemqinitialization in the following way.

Activemq以以下方式开始初始化。

  C:\Users\Infratab Bangalore\Desktop\Queueing\apache-activemq-5.8.0\bin>activemq

I am getting error,So I tested whether 61616(Activemq default port no)is in active with the following statement.

我收到错误,因此我61616(Activemq default port no)使用以下语句测试是否处于活动状态。

  C:\Users\Infratab Bangalore>netstat -an|find "61616"
   TCP    0.0.0.0:61616          0.0.0.0:0              LISTENING
   TCP    [::]:61616             [::]:0                 LISTENING

Finally I understand 61616port is active so I want to change my port number.

最后我知道61616端口是活动的,所以我想更改我的端口号。

  1. Am I right, what I am thinking?

  2. How can I install Activemq.

  1. 我是对的,我在想什么?

  2. 我该如何安装Activemq.

Thanks.

谢谢。

采纳答案by Brinnis

I believe your problem is there is already something running on port 61616. (It could be another instance of ActiveMQ you started on accident).

我相信你的问题是端口 61616 上已经有一些东西在运行。(它可能是你意外启动的另一个 ActiveMQ 实例)。

You can change the port for ActiveMQ in the activemq.xml file. Just do a find on 61616 and replace it with the port you would like to use (it should be in the <transportConnector>tag with the name openwire).

您可以在 activemq.xml 文件中更改 ActiveMQ 的端口。只需在 61616 上查找并将其替换为您要使用的端口(它应该在<transportConnector>名称为 的标签中openwire)。

You do not have to install ActiveMQ, simply launch activemq.batin the bin folder to start the standalone service.

您不必安装 ActiveMQ,只需activemq.bat在 bin 文件夹中启动即可启动独立服务。