- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用ActiveMQ 5.15.8。我使用 node.js 中的 STOMP 协议(protocol)和库 stompit 连接到它。
生产者代码片段:
var headers = {
'destination':'/topic/xyz',
'persistent':'true',
'content-type':'binary/octet-stream',
'content-length':9999,
'selector': "key = 'A'"
}
var frame = client.send(headers)
消费者代码订阅片段:
client.subscribe({'ack':'client-individual',
'activemq.retroactive':'true',
'activemq.subscriptionName':'name',
'destination':'/topic/xyz',
'selector':"key = 'A'"},(err,msg)=>{})
问题是我无法获得正确的选择器。我无法使用上述代码接收任何消息。我也尝试过使用:
'selector':'key=A'
这样我就可以收到所有消息,但不会根据 key 进行过滤。
有人可以帮我正确选择这个选择器吗?我再次使用 Node.js 库 stompit。
谢谢
最佳答案
当您发送消息时,您不会应用选择器
header 。您只需应用一个键/值,例如:
var headers = {
'destination':'/topic/xyz',
'persistent':'true',
'content-type':'binary/octet-stream',
'content-length':9999,
'key': "A"
}
var frame = client.send(headers)
然后您的消费者的选择器将对该 header 进行操作。保持消费者的选择器
定义相同。一旦您更新了生产者,它就应该可以工作。
就其值(value)而言,选择器使用 here 中描述的 SQL92 条件表达式语法的子集。 (向下滚动到“消息选择器”部分)。为此引用 JMS 文档似乎很奇怪,但 STOMP 规范没有定义与选择器相关的任何内容。但是,为了方便起见,已经为其 JMS 客户端(如 ActiveMQ)实现它的代理将其公开给 STOMP 客户端。
关于node.js - 无法在 ActiveMQ 中使用 STOMP 选择器过滤消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55153662/
我正在通过 Sock.JS 客户端发送 stomp 消息。当我断开服务器连接时,我希望在客户端上显示一条警告消息。为此,我实现了服务器端心跳 stompClient = Stomp.over(sock
我们有一个 Spring over WebSockets 连接,我们正在传递一个 CONNECT框架: CONNECT\naccept-version:1.2\nheart-beat:10000,10
当用户使用 @SubscribeMapping 注释订阅 stomp 用户目的地时,我试图得到通知。我的想法是在它加入时发送一些初始化数据。 虽然我无法让这个工作: Javascript: stomp
我正在开发一个利用 websockets 工具的 Spring 应用程序。为了使其更健壮,我使用了 STOMP/SimpleBrokerMessageHandler,如文档中所述。一切顺利,我已经能够
从 Spring 4 开始,我们支持 STOMP (子)协议(protocol)超过 WebSocket .我确实了解 WebSocket 的好处与 HTTP 相比,使用 STOMP 的用途和好处超过
STOMP 规范规定订阅必须有id header。 https://stomp.github.io/stomp-specification-1.2.html#SUBSCRIBE_id_Header S
有没有办法获取STOMP客户端IP地址?我正在拦截入站 channel ,但我看不到任何检查 IP 地址的方法。 任何帮助表示赞赏。 最佳答案 您可以在与 HandshakeInterceptor 握
我是 Flutter 新手。我正在尝试连接到使用 stomp 的 spring websocket,但连接失败。我正在使用 stomp_dart_client 0.3.3。 Spring服务器工作正常
我正在尝试在 puppetmaster(开源 puppet )上设置 mcollective/activemq。我遇到了 ActiveMQ 无法识别 Stomp 协议(protocol)的问题。这是我
我尝试使用 sockjs 和 stomp.js ( http://jmesnil.net/stomp-websocket/doc/ ) 为 vert.x stomp 服务器编写一个简单的 javasc
我发现 Spring WebSocket Support 的当前文档令人惊讶。指导用户使用 stomp.js用于他们的客户端 JavaScript 实现。 这个项目,在它的 GitHub 页面上的自述
以下测试客户端代码(使用 https://github.com/jmesnil/stomp-websocket )在 JBoss 7.0.1 中产生异常: var client = Stomp.cli
我在 Websockets 上使用带有 STOMP 协议(protocol)的 Springwebsockets,并且我正在使用内存中的 borker。我想向特定用户发送消息。 在客户端,我订阅了一个
我正在使用以下代码创建/订阅主题并处理消息。有时连接丢失并且错误显示: Whoops! The connection was lost... 我想知道有没有办法重新连接它。是否可以在错误回调中或在方法
我正在使用 Spring WebSockets。它运行良好,但现在我需要在将消息发送到 Web 客户端之前对其进行修改。 因此我创建了以下拦截器: @Component public class St
我有一个要求是一些 STOMP websocket 连接需要同步处理。 意思是我有一个客户(spring)订阅了一个主题(“/topic”)。 我有一个服务器 (spring),它定义了代理 ("/t
我目前的stomp客户端流程设计如下: 打开stomp连接(发送CONNECT帧) 订阅提要(发送 SUBSCRIBE 帧) 做一个循环以持续接收提要: while (true) {
我想知道是否有一种方法可以在发送消息之前检查消费者是否正在运行?我正在使用最新的 php STOMP,并且正在努力查看是否有一种方法可以在发送消息之前检测它是否正在运行,并在队列中建立消息。 谢谢,史
我正在寻找 Stomp.js 或类似的库。我没有发现使用 angular2.rc6/final 示例或 lib。我怎样才能重新放置 Stomp.js 其他东西?在我之前使用 Angular 1.X 的
我使用的是 Artemis 2.6.2,只有 STOMP 和以下星座: 经纪人: 没有在 broker.xml 中配置队列,一切都是自动创建的。 服务器: 订阅目标 TaskResponse 没有选择
我是一名优秀的程序员,十分优秀!