在 WSO2 CEP 3.1.0 中处理 MQTT 消息 [英] Handling MQTT messages in WSO2 CEP 3.1.0

查看:13
本文介绍了在 WSO2 CEP 3.1.0 中处理 MQTT 消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,其中我有 MQTT 发布者.

I have a scenario in which I have MQTT publisher.

MQTT 客户端 --> 消息代理 --> WSO2 CEP(JMS 输入适配器)

MQTT Client --> Message Broker --> WSO2 CEP (JMS input adaptor)

我可以通过哪些方式将此已发布的 MQTT 消息作为 WSO2 CEP 的输入?

What are the ways by which I can get this published MQTT message as input to WSO2 CEP?

我尝试使用 ActiveMQ 作为消息代理和 CEP JMS 输入适配器来侦听 JMS 消息,但 ActiveMQ 将 MQTT 消息转换为 ByteMessage,我相信 CEP 目前还没有处理它,因为在同一设置中发布的 JMS 消息正在工作很好.
我知道 WSO2 CEP 4.0.0 具有 MQTT 输入适配器的功能.如何在 CEP 3.1.0 中处理它?<​​/p>

I tried using ActiveMQ as a message broker and a CEP JMS input adaptor listening to JMS message but ActiveMQ transforms MQTT message as ByteMessage, I believe CEP does not handles it as of now, as JMS messages published in the same setup is working fine.
I know WSO2 CEP 4.0.0 has a feature of MQTT input adaptor. How can I handle it in CEP 3.1.0?

推荐答案

是的,我们还没有处理 CEP 3.1.0 中 JMS 输入事件适配器的 ByteMessage 场景.但是,我们已经在 CEP 4.0.0(以及随 BAM 2.5.0 发布的 CEP 功能)中修复了这个问题

Yes, We haven't handled the ByteMessage scenario for JMS input event adapter in CEP 3.1.0. But, we have fixed this in CEP 4.0.0 (and in CEP features which released with BAM 2.5.0)

我喜欢提供一些选项以使其与 CEP 3.1.0 一起使用.正如 Tharik 提到的,MQTT 输入事件适配器功能可从下一个 CEP 版本 (4.0.0) 中获得.以下是可能的选项.

I like to provide some options to make it work with CEP 3.1.0 .. As Tharik mentioned MQTT input event adapter feature is available from next CEP version (4.0.0). Below are the possible options.

1) 您可以修补 JMS 输入事件适配器并将其作为 CEP 服务器的修补程序包含在内.(修复可在 [1] 中找到)

1) You can either patch the JMS input event adpter and include that as a patch for CEP server. (Fix is available in [1])

2) 使用 BAM 2.5.0 中可用的 MQTT 输入事件适配器 jar.(编译源码[2]并将jar复制到CEP的dropins文件夹并按照[3])

2) Use the MQTT input event adapter jars which available in BAM 2.5.0. (Build the source [2] and copy the jar to dropins folder of CEP and follow [3])

3) 编写您自己的自定义 MQTT 输入事件适配器,如 [4] 中给出的

3) Write your own custom MQTT input event adapter as given in [4]

[1] https:///svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/event-stream/event-input-adaptor/org.wso2.carbon.event.input.adaptor.jms/1.0.2/src/main/java/org/wso2/carbon/event/input/adaptor/jms/internal/util/JMSMessageListener.java

[2] https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/event-stream/event-input-adaptor/org.wso2.carbon.event.input.adaptor.mqtt/1.0.0

[3] https://docs.wso2.com/display/BAM250/输入+MQTT+事件+适配器

[4] https://mohanadarshan.wordpress.com/2014/07/14/writing-custom-event-adaptors-in-wso2-cep-3-1-0/

谢谢..

这篇关于在 WSO2 CEP 3.1.0 中处理 MQTT 消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆