use of com.adaptris.core.jms.BasicJmsProducerCase.Loopback in project interlok by adaptris.
the class JmsProducerTest method testMultipleRequestorWithSession.
@Test
public void testMultipleRequestorWithSession() throws Exception {
String rfc6167 = "jms:queue:" + getName() + "";
ServiceList serviceList = new ServiceList(new Service[] { new StandaloneRequestor(activeMqBroker.getJmsConnection(), createProducer(rfc6167), new TimeInterval(1L, TimeUnit.SECONDS)), new StandaloneRequestor(activeMqBroker.getJmsConnection(), createProducer(rfc6167), new TimeInterval(1L, TimeUnit.SECONDS)) });
Loopback echo = createLoopback(activeMqBroker, getName());
try {
echo.start();
start(serviceList);
AdaptrisMessage msg1 = createMessage();
AdaptrisMessage msg2 = createMessage();
serviceList.doService(msg1);
serviceList.doService(msg2);
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg1.getContent());
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg2.getContent());
} finally {
stop(serviceList);
echo.stop();
}
}
use of com.adaptris.core.jms.BasicJmsProducerCase.Loopback in project interlok by adaptris.
the class JmsProducerTest method testRequest_DefinedReplyTo.
@Test
public void testRequest_DefinedReplyTo() throws Exception {
String rfc6167 = String.format("jms:queue:%1$s?replyToName=%1$s_reply", getName());
StandaloneRequestor serviceList = new StandaloneRequestor(activeMqBroker.getJmsConnection(), createProducer(rfc6167), new TimeInterval(1L, TimeUnit.SECONDS));
Loopback echo = createLoopback(activeMqBroker, getName());
try {
echo.start();
start(serviceList);
AdaptrisMessage msg = createMessage();
serviceList.doService(msg);
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg.getContent());
} finally {
stop(serviceList);
echo.stop();
}
}
use of com.adaptris.core.jms.BasicJmsProducerCase.Loopback in project interlok by adaptris.
the class JmsProducerTest method testRequest_AsyncReplyTo_Metadata.
@Test
public void testRequest_AsyncReplyTo_Metadata() throws Exception {
String rfc6167 = "jms:queue:" + getName() + "";
StandaloneRequestor serviceList = new StandaloneRequestor(activeMqBroker.getJmsConnection(), createProducer(rfc6167), new TimeInterval(1L, TimeUnit.SECONDS));
Loopback echo = createLoopback(activeMqBroker, getName());
try {
echo.start();
start(serviceList);
AdaptrisMessage msg = createMessage();
msg.addMetadata(JmsConstants.JMS_ASYNC_STATIC_REPLY_TO, getName() + "_reply");
serviceList.doService(msg);
assertEquals(DEFAULT_PAYLOAD.toUpperCase(), msg.getContent());
} finally {
stop(serviceList);
echo.stop();
}
}
Aggregations