use of com.adaptris.core.jms.DefinedJmsProducer in project interlok by adaptris.
the class BasicActiveMqConsumerTest method testTopicProduceAndConsumeWithExplicitFallbackMessageTranslation.
@Test
public void testTopicProduceAndConsumeWithExplicitFallbackMessageTranslation() throws Exception {
PasConsumer consumer = new PasConsumer().withTopic(getName());
consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
consumer.setMessageTranslator(new AutoConvertMessageTranslator());
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJmsConnection(createVendorImpl()), consumer);
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
DefinedJmsProducer producer = new PasProducer().withTopic(getName());
producer.setMessageTranslator(new BytesMessageTranslator());
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection(createVendorImpl()), producer);
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms, 1);
}
use of com.adaptris.core.jms.DefinedJmsProducer in project interlok by adaptris.
the class BasicActiveMqConsumerTest method testTopicProduceAndConsumeWithImplicitFallbackMessageTranslation.
@Test
public void testTopicProduceAndConsumeWithImplicitFallbackMessageTranslation() throws Exception {
PasConsumer consumer = new PasConsumer().withTopic(getName());
consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJmsConnection(createVendorImpl()), consumer);
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
DefinedJmsProducer producer = new PasProducer().withTopic(getName());
producer.setMessageTranslator(new BytesMessageTranslator());
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection(createVendorImpl()), producer);
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms, 1);
}
use of com.adaptris.core.jms.DefinedJmsProducer in project interlok by adaptris.
the class BasicActiveMqConsumerTest method testQueueProduceAndConsumeWithExplicitFallbackMessageTranslation.
@Test
public void testQueueProduceAndConsumeWithExplicitFallbackMessageTranslation() throws Exception {
PtpConsumer consumer = new PtpConsumer().withQueue(getName());
consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
consumer.setMessageTranslator(new AutoConvertMessageTranslator());
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJmsConnection(createVendorImpl()), consumer);
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
DefinedJmsProducer producer = new PtpProducer().withQueue((getName()));
producer.setMessageTranslator(new BytesMessageTranslator());
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection(createVendorImpl()), producer);
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms, 1);
}
use of com.adaptris.core.jms.DefinedJmsProducer in project interlok by adaptris.
the class BasicActiveMqConsumerTest method testQueueProduceAndConsumeWithImplicitFallbackMessageTranslation.
@Test
public void testQueueProduceAndConsumeWithImplicitFallbackMessageTranslation() throws Exception {
PtpConsumer consumer = new PtpConsumer().withQueue(getName());
consumer.setAcknowledgeMode("AUTO_ACKNOWLEDGE");
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJmsConnection(createVendorImpl()), consumer);
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
DefinedJmsProducer producer = new PtpProducer().withQueue((getName()));
producer.setMessageTranslator(new BytesMessageTranslator());
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJmsConnection(createVendorImpl()), producer);
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms, 1);
}
use of com.adaptris.core.jms.DefinedJmsProducer in project interlok by adaptris.
the class JmsProducerCase method testSetPriority.
@Test
public void testSetPriority() throws Exception {
DefinedJmsProducer p = createDummyProducer();
assertEquals(Integer.valueOf(1), p.getPriority());
assertEquals(1, p.messagePriority());
p.setPriority(null);
assertEquals(null, p.getPriority());
assertEquals(4, p.messagePriority());
}
Aggregations