简体   繁体   English

ActiveMQ ConnectionFailedException

[英]ActiveMQ ConnectionFailedException

I am trying to post a message to ActiveMQ using JMS, 我正在尝试使用JMS向ActiveMQ发布消息,

String loginID="admin";
String loginPswd="admin";
String hostName="svful0000283np.nyzdc.local";
String channel="http";
String portNumber="8161";
String hostUrl=channel + "://" + hostName + ":" + portNumber;
String inputQueue="com.nbn.telecom.sap.ManageSQ";
String outputQueue="com.nbn.telecom.sap.ManageSQ.response";

String messageText="my text";                              
ConnectionFactory factory = new ActiveMQConnectionFactory(loginID, loginPswd,hostUrl);         
Connection connection = factory.createConnection();   
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Last statement in the above gives the below error message - 上面的最后一条语句给出了以下错误消息-

   org.apache.activemq.ConnectionFailedException: The JMS connection has failed:            Failed to perform GET on: http://svful0000283np.nyzdc.local:8161 Reason: null

What could be the reason for the error? 错误的原因可能是什么? Thanks for your help in advance 谢谢您的帮助

While grasping your Question again, I am seeing 8161 port... it is jetty default port ..... that provision ActiveMQ Admin Console for its Administration..... 再次抓住您的问题时,我看到8161端口...这是码头默认端口 .....为其管理配置了ActiveMQ管理控制台

You could only use its messaging ports for messaging..... Port 61616, 5672, 61613, 1883, 61614 for openwire, amqp, stomp, mqtt, ws protocol messaging respectively..... 您只能使用其消息传递端口进行消息传递.....端口61616、5672、61613、1883、61614分别用于openwire,amqp,stomp,mqtt,ws协议消息传递。

That config resides right here.... on '[ACTIVEMQ_HOME]/ conf/activemq.xml ' 该配置位于此处。...上的[ACTIVEMQ_HOME] / conf / activemq.xml上

          <transportConnectors>
                <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
                <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
                <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
                <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
                <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
                <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
          </transportConnectors>

You could change port to some other number if it doesn't conflicts.... 如果不冲突,您可以将端口更改为其他号码。

0.0.0.0 works only for loopback ip 127.0.0.1... I mean only at localhost.... 0.0.0.0仅适用于回送ip 127.0.0.1 ...我的意思是仅适用于本地主机....

Else replace ip 0.0.0.0 by finding ip by ifconfig if it is unix..... else ipconfig if it is Windows or DOS based... that should be done on the machine where you are running ActiveMQ 否则,通过ifconfig查找ip来替换ip 0.0.0.0(如果它是unix .....);如果是基于Windows或DOS的话,则使用ipconfig替换ip 0.0.0.0。应该在运行ActiveMQ的计算机上完成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM