use of com.adaptris.core.jms.PasPollingConsumer in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method createStandalone.
private StandaloneConsumer createStandalone(EmbeddedActiveMq mq, String threadName, String destinationName) throws Exception {
PasPollingConsumer consumer = new PasPollingConsumer().withTopic(destinationName);
consumer.setPoller(new Sometime());
JmsConnection c = mq.getJmsConnection();
consumer.setVendorImplementation(c.getVendorImplementation());
consumer.setClientId(c.getClientId());
consumer.setSubscriptionId(MY_SUBSCRIPTION_ID);
consumer.setReacquireLockBetweenMessages(true);
consumer.setAdditionalDebug(true);
consumer.setReceiveTimeout(new TimeInterval(Integer.valueOf(new Random().nextInt(100) + 100).longValue(), TimeUnit.MILLISECONDS));
StandaloneConsumer sc = new StandaloneConsumer(consumer);
return sc;
}
use of com.adaptris.core.jms.PasPollingConsumer in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitSubscriptionOnly.
@Test
public void testInitSubscriptionOnly() throws Exception {
PasPollingConsumer consumer = create();
consumer.setSubscriptionId("xxxx");
try {
consumer.init();
fail("Should fail due to missing client Id");
} catch (CoreException e) {
// expected
}
}
use of com.adaptris.core.jms.PasPollingConsumer in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitNoClientIdOrSubscriptionId.
@Test
public void testInitNoClientIdOrSubscriptionId() throws Exception {
PasPollingConsumer consumer = create();
try {
consumer.init();
fail("Should fail due to missing subscription Id, client Id");
} catch (CoreException e) {
// expected
}
}
use of com.adaptris.core.jms.PasPollingConsumer in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method testInitClientAndSubscriptionSet.
@Test
public void testInitClientAndSubscriptionSet() throws Exception {
PasPollingConsumer consumer = create();
consumer.setClientId("xxxx");
consumer.setSubscriptionId("xxxx");
try {
consumer.init();
} catch (CoreException e) {
fail(e.getMessage());
}
}
use of com.adaptris.core.jms.PasPollingConsumer in project interlok by adaptris.
the class ActiveMqPasPollingConsumerTest method create.
private static PasPollingConsumer create() {
PasPollingConsumer consumer = new PasPollingConsumer().withTopic("destination");
consumer.setVendorImplementation(new BasicActiveMqImplementation());
consumer.registerAdaptrisMessageListener(new StandardWorkflow());
return consumer;
}
Aggregations