use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class JmsProducerTest method retrieveSampleConfig.
private StandaloneProducer retrieveSampleConfig(boolean useQueue) {
JmsConnection c = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616"));
String dest = "jms:topic:myTopicName?priority=4";
if (useQueue) {
dest = "jms:queue:myQueueName?priority=4";
}
JmsProducer p = new JmsProducer().withEndpoint(dest);
c.setConnectionErrorHandler(new JmsConnectionErrorHandler());
NullCorrelationIdSource mcs = new NullCorrelationIdSource();
p.setCorrelationIdSource(mcs);
StandaloneProducer result = new StandaloneProducer();
result.setConnection(c);
result.setProducer(p);
return result;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class JmsSyncConsumerTest method retrieveObjectsForSampleConfig.
@Override
protected List<?> retrieveObjectsForSampleConfig() {
JmsConnection connection = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616"));
ArrayList<StandaloneConsumer> result = new ArrayList<>();
boolean useQueue = true;
for (MessageTypeTranslator t : MESSAGE_TRANSLATOR_LIST) {
StandaloneConsumer p = createStandaloneConsumer(connection, useQueue, false);
((JmsSyncConsumer) p.getConsumer()).setMessageTranslator(t);
result.add(p);
useQueue = !useQueue;
}
return result;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class BasicPtpProducerActiveErrorHandlerTest method retrieveObjectForSampleConfig.
@Override
protected Object retrieveObjectForSampleConfig() {
JmsConnection p = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616"));
ActiveJmsConnectionErrorHandler erHandler = new ActiveJmsConnectionErrorHandler();
erHandler.setCheckInterval(new TimeInterval(30L, TimeUnit.SECONDS));
p.setConnectionErrorHandler(erHandler);
return new StandaloneProducer(p, new PtpProducer().withQueue("TheQueueToProduceTo"));
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class PasProducerTest method retrieveSampleConfig.
private StandaloneProducer retrieveSampleConfig() {
PasProducer p = new PasProducer().withTopic("topicName");
JmsConnection c = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616"));
c.setConnectionErrorHandler(new JmsConnectionErrorHandler());
NullCorrelationIdSource mcs = new NullCorrelationIdSource();
p.setCorrelationIdSource(mcs);
StandaloneProducer result = new StandaloneProducer();
result.setConnection(c);
result.setProducer(p);
return result;
}
use of com.adaptris.core.jms.activemq.BasicActiveMqImplementation in project interlok by adaptris.
the class JmsConnectionErrorHandlerTest method testJmsAllowedInConjunctionWith_NullConnectString.
@Test
public void testJmsAllowedInConjunctionWith_NullConnectString() throws Exception {
JmsConnectionErrorHandler jms1 = new JmsConnectionErrorHandler();
JmsConnection c = new JmsConnection(new BasicActiveMqImplementation("tcp://localhost:61616"));
jms1.registerConnection(c);
JmsConnectionErrorHandler jms2 = new JmsConnectionErrorHandler();
jms2.registerConnection(c);
assertFalse(jms1.allowedInConjunctionWith(jms2));
}
Aggregations