use of com.adaptris.core.jms.PtpConsumer 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.PtpConsumer in project interlok by adaptris.
the class JndiPtpProducerCase method testProduceAndConsume.
@Test
public void testProduceAndConsume() throws Exception {
StandardJndiImplementation recvVendorImp = createVendorImplementation();
StandardJndiImplementation sendVendorImp = createVendorImplementation();
String queueName = testName.getMethodName() + "_queue";
String topicName = testName.getMethodName() + "_topic";
StandaloneConsumer standaloneConsumer = new StandaloneConsumer(activeMqBroker.getJndiPtpConnection(recvVendorImp, false, queueName, topicName), new PtpConsumer().withQueue((queueName)));
MockMessageListener jms = new MockMessageListener();
standaloneConsumer.registerAdaptrisMessageListener(jms);
StandaloneProducer standaloneProducer = new StandaloneProducer(activeMqBroker.getJndiPtpConnection(sendVendorImp, false, queueName, topicName), new PtpProducer().withQueue((queueName)));
execute(standaloneConsumer, standaloneProducer, createMessage(null), jms);
assertMessages(jms);
}
Aggregations