Search in sources :

Example 16 with BasicActiveMqImplementation

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;
}
Also used : BasicActiveMqImplementation(com.adaptris.core.jms.activemq.BasicActiveMqImplementation) StandaloneProducer(com.adaptris.core.StandaloneProducer)

Example 17 with BasicActiveMqImplementation

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;
}
Also used : BasicActiveMqImplementation(com.adaptris.core.jms.activemq.BasicActiveMqImplementation) ArrayList(java.util.ArrayList) StandaloneConsumer(com.adaptris.core.StandaloneConsumer)

Example 18 with BasicActiveMqImplementation

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"));
}
Also used : BasicActiveMqImplementation(com.adaptris.core.jms.activemq.BasicActiveMqImplementation) TimeInterval(com.adaptris.util.TimeInterval) StandaloneProducer(com.adaptris.core.StandaloneProducer)

Example 19 with BasicActiveMqImplementation

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;
}
Also used : BasicActiveMqImplementation(com.adaptris.core.jms.activemq.BasicActiveMqImplementation) StandaloneProducer(com.adaptris.core.StandaloneProducer)

Example 20 with BasicActiveMqImplementation

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));
}
Also used : BasicActiveMqImplementation(com.adaptris.core.jms.activemq.BasicActiveMqImplementation) Test(org.junit.Test)

Aggregations

BasicActiveMqImplementation (com.adaptris.core.jms.activemq.BasicActiveMqImplementation)24 Test (org.junit.Test)9 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)7 TimeInterval (com.adaptris.util.TimeInterval)7 StandaloneProducer (com.adaptris.core.StandaloneProducer)5 ArrayList (java.util.ArrayList)4 MockChannel (com.adaptris.core.stubs.MockChannel)3 AdaptrisComponent (com.adaptris.core.AdaptrisComponent)2 Channel (com.adaptris.core.Channel)2 CoreException (com.adaptris.core.CoreException)2 JmsConnection (com.adaptris.core.jms.JmsConnection)2 PtpProducer (com.adaptris.core.jms.PtpProducer)2 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)1 DefaultMessageFactory (com.adaptris.core.DefaultMessageFactory)1 PtpConsumer (com.adaptris.core.jms.PtpConsumer)1 Base64DecodeService (com.adaptris.core.services.Base64DecodeService)1 Base64EncodeService (com.adaptris.core.services.Base64EncodeService)1 ReplaceWithFirstMessage (com.adaptris.core.services.aggregator.ReplaceWithFirstMessage)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1