Search in sources :

Example 51 with PtpProducer

use of com.adaptris.core.jms.PtpProducer in project interlok by adaptris.

the class DefaultEventHandlerTest method retrieveObjectForSampleConfig.

/**
 * @see com.adaptris.core.ExampleConfigCase#retrieveObjectForSampleConfig()
 */
@Override
protected Object retrieveObjectForSampleConfig() {
    Adapter result = null;
    try {
        AdaptrisMessageProducer p = new PtpProducer().withQueue("publishEventsTo");
        DefaultEventHandler eh = new DefaultEventHandler();
        eh.setConnection(new JmsConnection(new StandardJndiImplementation("MyConnectionFactoryName")));
        eh.setProducer(p);
        eh.setMarshaller(DefaultMarshaller.getDefaultMarshaller());
        result = new Adapter();
        result.setChannelList(new ChannelList());
        result.setEventHandler(eh);
        result.setUniqueId(UUID.randomUUID().toString());
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return result;
}
Also used : StandardJndiImplementation(com.adaptris.core.jms.jndi.StandardJndiImplementation) PtpProducer(com.adaptris.core.jms.PtpProducer) JmsConnection(com.adaptris.core.jms.JmsConnection)

Example 52 with PtpProducer

use of com.adaptris.core.jms.PtpProducer in project interlok by adaptris.

the class RetryingServiceWrapperTest method retrieveObjectForSampleConfig.

@Override
protected Object retrieveObjectForSampleConfig() {
    JmsConnection connection = new JmsConnection();
    connection.setVendorImplementation(new StandardJndiImplementation("MyConnectionFactory"));
    StandaloneProducer wrappedService = new StandaloneProducer();
    wrappedService.setConnection(connection);
    wrappedService.setProducer(new PtpProducer().withQueue(("MyQueueName")));
    RetryingServiceWrapper service = new RetryingServiceWrapper();
    service.setUniqueId("Retrying Service Wrapper");
    service.setNumRetries(10);
    service.setRestartOnFailure(true);
    service.setDelayBetweenRetries(new TimeInterval(10L, TimeUnit.SECONDS));
    service.setService(wrappedService);
    return service;
}
Also used : TimeInterval(com.adaptris.util.TimeInterval) StandardJndiImplementation(com.adaptris.core.jms.jndi.StandardJndiImplementation) JmsConnection(com.adaptris.core.jms.JmsConnection) PtpProducer(com.adaptris.core.jms.PtpProducer) StandaloneProducer(com.adaptris.core.StandaloneProducer)

Aggregations

PtpProducer (com.adaptris.core.jms.PtpProducer)52 StandaloneProducer (com.adaptris.core.StandaloneProducer)46 Test (org.junit.Test)46 PtpConsumer (com.adaptris.core.jms.PtpConsumer)24 StandaloneConsumer (com.adaptris.core.StandaloneConsumer)23 MockMessageListener (com.adaptris.core.stubs.MockMessageListener)23 MockChannel (com.adaptris.core.stubs.MockChannel)14 Channel (com.adaptris.core.Channel)13 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)12 JmsTransactedWorkflow (com.adaptris.core.jms.JmsTransactedWorkflow)12 MockMessageProducer (com.adaptris.core.stubs.MockMessageProducer)10 JmsConnection (com.adaptris.core.jms.JmsConnection)8 StandardJndiImplementation (com.adaptris.core.jms.jndi.StandardJndiImplementation)6 ThrowExceptionService (com.adaptris.core.services.exception.ThrowExceptionService)6 ConfiguredException (com.adaptris.core.services.exception.ConfiguredException)5 BytesMessageTranslator (com.adaptris.core.jms.BytesMessageTranslator)4 TimeInterval (com.adaptris.util.TimeInterval)4 ProduceException (com.adaptris.core.ProduceException)3 Service (com.adaptris.core.Service)3 StandaloneRequestor (com.adaptris.core.StandaloneRequestor)3