How can I do a Storm spout that listen an ActiveMQ topic?

烈酒焚心 提交于 2019-12-24 03:20:49

问题


I programmed a Storm topology that listens on particular topic on kafka with its spouts. Now I have to migrate it on activeMQ. Is possible to reproduce these topics with activeMQ and create spouts that listen them as I did with kafka?

I googled it, but it is not clear how I can send a message to a topic or listen a particular topic. In kafka a do something like

data = new KeyedMessage<>("topic", sms);
producer.send(data);

to send sms on topic and just create a

new kafkaspout("topic") 

to listen it. In activeMQ?

It seems I have to do

Queue queue = session.createQueue("topic");

as many times as the number of topics and then to listen them I have to write something like

Queue queue = session.createQueue("topic");
consumer = session.createConsumer(queue);

I'm not sure this is the right approach and I'd like to be supported by any suggestions!

来源:https://stackoverflow.com/questions/29011243/how-can-i-do-a-storm-spout-that-listen-an-activemq-topic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!