我被困在这里几天,我们将为您提供任何帮助。我正在与ActiveMQ Artemis代理建立连接,调用connect时看不到错误。一段时间(几分钟后)后,我看到连接超时错误。另外,我没有看到正在创建的队列(仅地址)正在创建,并且在Artemis控制台上看不到该消息。请提出建议。
代码:
const stompConnectOptions= {
'host': 'localhost',
'port': 61613,
'connectHeaders': {
'host': '/', 'login': 'admin', 'passcode': 'xxxx', 'heart-beat': '1000,1000'
}
};
const stompit=require ('stompit') const subscribeHeaders= {
'destination': 'emailEvent', 'ack': 'client-individual'
};
const sendHeaders= {
'destination': '/queue/TestEvent', 'content-type': 'text/plain'
};
stompit.connect(stompConnectOptions, (err, client)=> {
if (err) {
console.log("error with stomp connection.");
return;
}
console.log("stomp connected") stompClient=client;
const frame=client.send(sendHeaders);
frame.write('hello');
frame.end();
console.log('hello message sent')
});
2020-01-29 23:33:46,333 WARN [org.apache.activemq.artemis.core.protocol.stomp] AMQ332069: Sent ERROR frame to STOMP client /127.0.0.1:52170: null
2020-01-29 23:33:46,334 WARN [org.apache.activemq.artemis.core.server] AMQ222067: Connection failure has been detected: null [code=REMOTE_DISCONNECT]
2020-01-29 23:33:46,335 WARN [org.apache.activemq.artemis.core.server] AMQ222061: Client connection failed, clearing up resources for session 21617631-4319-11ea-a1bd-24a2e1f3b27a
2020-01-29 23:33:46,337 WARN [org.apache.activemq.artemis.core.server] AMQ222107: Cleared up resources for session 21617631-4319-11ea-a1bd-24a2e1f3b27a
我是新手,在这里需要您专家的建议。如果您需要其他详细信息,请告诉我。
[如果您动态创建队列,它们将在您的s上使用类似于ChatQueue的地址进行创建。但是,如果您向该地址发送消息并且他不存在,则将创建他,但没有队列。
因此要使用队列来创建地址,您可以像这样编辑broker.xml
<addresses>
<address name="TestAddress">
<anycast>
<queue name="TestQueue" />
</anycast>
</address>
</addresses>
或者您可以从网站添加队列到地址。您必须单击地址,然后在右侧将看到创建按钮。