Package backtype.storm.contrib.jms

Examples of backtype.storm.contrib.jms.JmsProvider


public class JmsSpoutTest {
    @Test
    public void testFailure() throws JMSException, Exception{
        JmsSpout spout = new JmsSpout();
        JmsProvider mockProvider = new MockJmsProvider();
        MockSpoutOutputCollector mockCollector = new MockSpoutOutputCollector();
        SpoutOutputCollector collector = new SpoutOutputCollector(mockCollector);
        spout.setJmsProvider(new MockJmsProvider());
        spout.setJmsTupleProducer(new MockTupleProducer());
        spout.setJmsAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
        spout.setRecoveryPeriod(10); // Rapid recovery for testing.
        spout.open(new HashMap<String,String>(), null, collector);
        Message msg = this.sendMessage(mockProvider.connectionFactory(), mockProvider.destination());
        Thread.sleep(100);
        spout.nextTuple(); // Pretend to be storm.
        Assert.assertTrue(mockCollector.emitted);
       
        mockCollector.reset();       
View Full Code Here


  @SuppressWarnings("serial")
  public static void main(String[] args) throws Exception {

    // JMS Queue Provider
    JmsProvider jmsQueueProvider = new SpringJmsProvider(
        "jms-activemq.xml", "jmsConnectionFactory",
        "notificationQueue");
   
    // JMS Topic provider
    JmsProvider jmsTopicProvider = new SpringJmsProvider(
        "jms-activemq.xml", "jmsConnectionFactory",
        "notificationTopic");

    // JMS Producer
    JmsTupleProducer producer = new JsonTupleProducer();
View Full Code Here

TOP

Related Classes of backtype.storm.contrib.jms.JmsProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.