java - How to integrate jms topic to feed Storm spout -
i have activemq topic provider. need feed data received topic storm topic. there way directly or should create intermediate queue , feed topic data queue , pull data spout. best option?
i have went through ptgoetz's storm jms examples , made solution directly feed topic data spout.
need specify topic in jms-activemq.xml
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <amq:topic id="topic" physicalname="mytopic" /> <amq:connectionfactory id="jmsconnectionfactory" brokerurl="tcp://localhost:61616" /> </beans>
then can create jmsspout bellow jms acknowledge mode in session.auto_acknowledge
jmsprovider jmstopicprovider = new springjmsprovider("jms-activemq.xml", "jmsconnectionfactory", "topic"); jmstupleproducer producer = new jsontupleproducer(); jmsspout topicspout = new jmsspout(); topicspout.setjmsprovider(jmstopicprovider); topicspout.setjmstupleproducer(producer); topicspout.setjmsacknowledgemode(session.auto_acknowledge); topicspout.setdistributed(false);
Comments
Post a Comment