无法打开绑定到应用程序标头x-match表达式的接收器

问题描述 投票:1回答:1

我正在使用rhea(https://github.com/amqp/rhea),一个node.js库来开发AMQP 1.0客户端。

我正在尝试使用x-match表达式而不是JMS表达式来调整https://github.com/amqp/rhea/tree/master/examples/selector示例。

目的是实现基于AMQP 1.0兼容代理(ActiveMQ,Qpid,...)的头路由机制。

我在recv.js的相应部分尝试了这段代码:

connection.open_receiver({
    source: {
        address: 'amq.match',
        filter: {
            'x-match': 'all',
            value: {
                'nat': 'it',
                'prod': 'a22'
            }
        }
    }
})

收到连接错误“预期值类型为'过滤器',但从Qpid Java代理(rel.7.1.0)获得'String'amqp:decode-error”。

amqp qpid rhea
1个回答
1
投票

根据rhea github repo收到的回答:

https://github.com/amqp/rhea/issues/200#issuecomment-469220880

过滤器需要是描述的值。尝试这样的事情:

connection.open_receiver({
    source: {
        address: 'amq.match',
        filter: {
            'foo': amqp_types.wrap_described({
                'nat': 'it',
                'prod': 'a22',
                'x-match': 'all'
            }, 0x468C00000002)
        }
    }
});

哪里:

var amqp_types = require('rhea').types;

这只适用于Qpid cpp,它不能与ActiveMQ和Qpid java一起使用。

© www.soinside.com 2019 - 2024. All rights reserved.