- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
尝试通过 amqp10 使用 AMQP 1.0 协议(protocol)连接到我的 Apache ActiveMQ 代理。我正在使用以下代码(改编自自述文件中的原始示例):
const AMQPClient = require("amqp10").Client;
const Promise = require("bluebird");
//Fix from: https://github.com/noodlefrenzy/node-amqp10/issues/241
const activeMQPolicy = require("amqp10").Policy;
const client = new AMQPClient(activeMQPolicy.ActiveMQ);
const setUp = () => {
return Promise.all([
client.createReceiver("amq.topic"),
client.createSender("amq.topic")
]);
};
client.connect("amqp://localhost")
.then(setUp)
.spread(function (receiver, sender) {
receiver.on("errorReceived", function (err) {
if (err) {
console.log(`failed with error: ${err}`);
return;
}
receiver.on("message", message => console.log(`Rx message: ${message.body}`));
return sender.send({ key: "Value" });
});
})
.error( err => console.log("error: ", err));
执行失败并出现以下应用程序错误:
Workspace/activemq/node_modules/amqp10/lib/frames.js:64 stream.write(buffer, callback); ^
TypeError: Cannot read property 'write' of null at Object.frames.writeFrame (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/frames.js:64:9) at Connection.sendFrame (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/connection.js:329:10) at Connection._sendCloseFrame (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/connection.js:491:8) at Connection._receiveAny (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/connection.js:413:12) at Connection._receiveData (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/connection.js:358:8) at NetTransport. (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/connection.js:516:38) at emitOne (events.js:96:13) at NetTransport.emit (events.js:191:7) at Socket. (/home/pedro/Workspace/activemq/node_modules/amqp10/lib/transport/net_transport.js:26:49) at emitOne (events.js:96:13) at Socket.emit (events.js:191:7) at readableAddChunk (_stream_readable.js:178:18) at Socket.Readable.push (_stream_readable.js:136:10) at TCP.onread (net.js:560:20)
虽然 ActiveMQ 拒绝请求并显示以下消息:
WARN | Connection attempt from non AMQP v1.0 client. AMQP,0,1,0,0 WARN | Transport Connection to: tcp://127.0.0.1:53188 failed: org.apache.activemq.transport.amqp.AmqpProtocolException: Connection from client using unsupported AMQP attempted
我尝试实现此问题中描述的修复:
但是也没有成功。还尝试在 url 中指定端口 5672,但没有成功。
此时我非常确定应用程序写入失败,因为 ActiveMQ 将请求视为无效而拒绝。
最佳答案
在 ActiveMQ 论坛中询问后,事实证明@Tim 是正确的。引用用户 Gordon Sim-2 的话:
As of 5.14 (...) ActiveMQ requires a SASL layer, even if you use ANONYMOUS to authenticate. The examples for clients often don't explicitly authenticate in any way (...)
要解决此问题,有两种选择。
第一个是更改代码,这就是我正在寻找的:
To have the amqp10 client use a SASL layer, just specify a saslMechanism override on the connect e.g.
client.connect(uri, {'saslMechanism':'ANONYMOUS'})
这种方法是由另一个名为 rhea
的 AMQP 1.0 Node.js 库的创建者建议的。如果您正在阅读本文,我强烈建议您检查一下。
正如 Tim 建议的那样,第二个是更改代理配置文件。如果您选择这种方法,我建议您阅读他的文章,因为它更完整。
关于node.js - 无法使用 Node.js 连接到 Apache ActiveMQ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43873400/
场景: private readonly IConnection connection; this.connection = connectionFactory.CreateConnection();
想知道是否可以在 activeMQ 服务器中完成任何配置,将消息从 DLQ 重定向到同一服务器上的另一个队列。 例如。 我有一个队列“MAINQUEUE”,其中有很多消息已激活客户端确认,在处理时如果
我正在 ActiveMQ 中的一个系统上工作,我真的不想丢失消息。我的问题是重试消息导致我的消费者阻塞(而不是处理他们可以处理的消息)。我想给失败的消息几天重试(例如,我的潜在目的地之一是我将通过 S
我们对 AMQ 使用以下配置 定期我有奇怪的问题 - 松散的消息。实际上AMQ说一切正常并且消
我已按照教程安装 ActiveMQ http://servicebus.blogspot.com/2011/02/installing-apache-active-mq-on-ubuntu.html
当我们使用 ActiveMQ 时,我们可以信任 ActiveMQ 服务器的可靠性。例如在开发非实时软件时(不需要立即发送数据。但应该发送)。我们能否信任 activeMQ 作为确认消息传递的可靠来源。
我遇到了 issue使用 ActiveMQ 并希望跟踪/查看所有 ActiveMQ 事件。我能找到的唯一日志文件是与持久数据相关联的(如果打开的话)。我是否查看或生成了任何其他日志文件来告诉我 Act
我们正面临 ActiveMQ 及其使用者的随机问题。我们观察到,即使连接到 ActiveMQ 队列,也很少有消费者没有收到消息。但是在消费者重启后它工作正常。 我们在 ActiveMQ 端有一个名为
有什么方法可以跟踪 ActiveMQ 中的延迟(计划)消息? 我在 AMQ 网络控制台中没有看到任何东西,它们似乎只有在延迟到期时才进入队列……而且我在 JMX 控制台中也找不到它,也许我搜索得不够好
我对Apache ActiveMQ的功能感到困惑。 我从this link下载了ActiveMQ 。所以我这样使用它(环境:Windows 7):我启动 bin/activemq.bat,然后它就可以
我们有一个 ActiveMQ 代理,它使用 JMS、AMQP 和 MQTT 连接到不同的客户端。由于某种原因,我们还没有弄清楚一组特定的 MQTT 客户端经常(并非总是)持久订阅。这是一个测试环境,其
在activemq中有什么方法可以获取消息的数量代理端每秒/每分钟消耗/产生的数量? 我已经尝试使用http://activemq.apache.org/jmeter-performance-test
如何在队列上的 ActiveMQ 中设置 redeliveryPolicy? 1) 在文档中,请参阅:activeMQ Redelivery ,说明您应该在 ConnectionFactory 或 C
我查了一下,它用于在两个系统之间发送消息。 但为什么?为什么不直接使用数据库? 一定有一些 ActiveMQ 具有 数据库 没有的功能吗? 最佳答案 它用于在两个分布式进程之间进行可靠的通信。 是的,
我在生产系统中运行 ActiveMQ。我们的一些队列的流量非常大,而有些队列的流量非常低。我对镜像其中一个低容量队列感兴趣,这样我就可以围绕接收到的消息构建非正式的监控服务。 不幸的是,the onl
我们已经使用此配置为 ActiveMQ Broker 配置了 Broker redelivery 插件。
有什么方法可以检查特定队列是否已存在于 ActiveMQ 中? 最佳答案 http://activemq.apache.org/how-can-i-get-a-list-of-the-topics-a
有人知道如何将 activemq-core.xsd url 与 jar 文件 (activemq-core-5.2.0.jar) 中的 activemq.xsd 关联起来? 我在互联网上找到了一些解决
我是 activemq 的新手。我试图使用 activemq 代理来订阅/发布消息。但至于缺乏经验,我不知道该怎么做,也不知道是否真的可以做到。我在谷歌上搜索了很多,但不幸的是,没有适合此类功能的示例
我一直在努力配置 ActiveMQ 代理,让我感到困惑的一件事是,我读过的所有内容都将 NIO 描述为“如果您需要扩展的不错选择”或“如果您需要更快的速度” ,所以我的问题是他们为什么不说“总是使用
我是一名优秀的程序员,十分优秀!