我有一台服务器,任何公共IP的所有流量都通过代理。我已经配置了
https_proxy
和http_proxy
。
我想使用公共 IP 连接到在云中运行的 ActiveMQ Artemis。
现在,当我向 ActiveMQ 管理控制台输入
curl
命令时,我得到了响应,这意味着我能够访问服务器
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hawtio</title>
<base href='/activemq/'>
<link id="favicon" rel="icon" type="image/x-icon" href="img/favicon.ico?v=1">
<link rel="stylesheet" href="css/lib-6a1e4ce9ea.css"/>
<link rel="stylesheet" href="css/app-9653e9917c.css"/>
<!-- branding -->
<link id="branding" rel="stylesheet" type="text/css" href="" />
<script src="js/lib-e53c220218.js" defer></script>
<script src="js/app-fafe513f4b.js" defer></script>
</head>
<body>
<hawtio-login></hawtio-login>
</body>
</html>
如果我对 ActiveMQ 服务器进行 telnet,则会超时。
telnet <ip> 61616
经纪人.xml
<acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>
我尝试配置Netty over HTTP Protocol,但仍然超时
artemis producer --url "tcp://<ip>:61616?httpEnabled=true" --user "artemis" --password "artemis" --message-count 1
我收到此错误:
Exception in thread "main" javax.jms.JMSException: Failed to create session factory
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:915)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:314)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:309)
at org.apache.activemq.artemis.cli.commands.messages.Producer.execute(Producer.java:142)
at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:219)
at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:165)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:157)
at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:64)
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ219007: Cannot connect to server(s). Tried with all available servers.]
at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:735)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:913)
... 11 more
HTTP 实际上并不是一个好的消息传递协议,因为它是为完全不同的用例而设计的。如果你有机会避免使用它,你应该尝试一下。它确实适用于您完全别无选择的环境。无论如何,我认为客户或经纪人真的不能在这里做任何事情,因为问题似乎出现在网络的某个地方。