use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class PtpProducerTest method retrieveSampleConfig.
private StandaloneProducer retrieveSampleConfig() {
JmsConnection c = configureForExamples(new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616")));
c.setClientId(null);
StandaloneProducer result = new StandaloneProducer(c, configureForExamples(new PtpProducer().withQueue("SampleQ1")));
return result;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class PasConsumerTest method testDurable_WithSubscriptionId.
@Test
public void testDurable_WithSubscriptionId() throws Exception {
new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:16161"));
PasConsumer pas = new PasConsumer();
pas.setTopic("destination");
assertFalse(pas.durable());
pas.setSubscriptionId("MySubscriptionId");
assertTrue(pas.durable());
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class PasConsumerTest method retrieveSampleConfig.
protected StandaloneConsumer retrieveSampleConfig() {
JmsConnection c = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:16161"));
PasConsumer pc = new PasConsumer();
pc.setTopic("destination");
NullCorrelationIdSource mcs = new NullCorrelationIdSource();
pc.setCorrelationIdSource(mcs);
c.setConnectionErrorHandler(new JmsConnectionErrorHandler());
pc.setSubscriptionId("subscription-id");
StandaloneConsumer result = new StandaloneConsumer();
result.setConnection(c);
result.setConsumer(pc);
return result;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class RequestReplyWorkflowTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
Channel c = new Channel();
try {
c.setConsumeConnection(new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616")));
c.setProduceConnection(new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:2506")));
RequestReplyWorkflow workflow = new RequestReplyWorkflow();
workflow.getServiceCollection().addService(new Base64DecodeService());
workflow.setConsumer(new PtpConsumer().withQueue("inputQueue"));
workflow.setProducer(new PtpProducer().withQueue("outputQueue"));
workflow.setReplyProducer(new PtpProducer().withQueue("TODO"));
workflow.getReplyServiceCollection().addService(new Base64EncodeService());
c.getWorkflowList().add(workflow);
c.setUniqueId(UUID.randomUUID().toString());
workflow.setUniqueId(UUID.randomUUID().toString());
} catch (CoreException e) {
throw new RuntimeException(e);
}
return c;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class AdapterTest method createRetryingAdapter.
/**
* <p>
* Creates a valid Adapter to use in tests. Uese Mock aka Memory MessageConsumer / Producer.
* </p>
*
* @param uniqueId a uniqure identifier for this <code>Adapter</code>
*/
public static Adapter createRetryingAdapter(String uniqueId) throws Exception {
Adapter result = null;
AdaptrisConnection consume = new NullConnection();
JmsConnection produce = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:5000"));
produce.setConnectionRetryInterval(new TimeInterval(1L, TimeUnit.SECONDS.name()));
produce.setConnectionAttempts(20);
AdaptrisMessageProducer producer1 = new PtpProducer().withQueue("dummyQueue");
StandardWorkflow workflow1 = new StandardWorkflow();
workflow1.setProducer(producer1);
WorkflowList workflows = new WorkflowList();
workflows.add(workflow1);
Channel channel = new Channel();
channel.setUniqueId(uniqueId + "_c1");
channel.setConsumeConnection(consume);
channel.setProduceConnection(produce);
channel.setWorkflowList(workflows);
ChannelList channels = new ChannelList();
channels.addChannel(channel);
result = new Adapter();
result.setChannelList(channels);
result.setUniqueId(uniqueId);
return result;
}
Aggregations