Search in sources :

Example 6 with DeadLetterChannelBuilder

use of org.apache.camel.builder.DeadLetterChannelBuilder in project camel by apache.

the class OnExceptionErrorHandlerRefIssueTwoRoutesTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) DeadLetterChannelBuilder(org.apache.camel.builder.DeadLetterChannelBuilder)

Example 7 with DeadLetterChannelBuilder

use of org.apache.camel.builder.DeadLetterChannelBuilder in project camel by apache.

the class OnExceptionNotHandledErrorHandlerRefIssueTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) DeadLetterChannelBuilder(org.apache.camel.builder.DeadLetterChannelBuilder)

Example 8 with DeadLetterChannelBuilder

use of org.apache.camel.builder.DeadLetterChannelBuilder in project camel by apache.

the class OnExceptionNotHandledErrorHandlerRefIssueTwoRoutesTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    JndiRegistry jndi = super.createRegistry();
    jndi.bind("myDLC", new DeadLetterChannelBuilder("mock:dead"));
    return jndi;
}
Also used : JndiRegistry(org.apache.camel.impl.JndiRegistry) DeadLetterChannelBuilder(org.apache.camel.builder.DeadLetterChannelBuilder)

Example 9 with DeadLetterChannelBuilder

use of org.apache.camel.builder.DeadLetterChannelBuilder in project camel by apache.

the class ErrorHandlerDefinitionParserTest method testDeadLetterErrorHandler.

public void testDeadLetterErrorHandler() {
    DeadLetterChannelBuilder errorHandler = ctx.getBean("deadLetterErrorHandler", DeadLetterChannelBuilder.class);
    assertNotNull(errorHandler);
    assertEquals("Get wrong deadletteruri", "log:dead", errorHandler.getDeadLetterUri());
    RedeliveryPolicy policy = errorHandler.getRedeliveryPolicy();
    assertNotNull(policy);
    assertEquals("Wrong maximumRedeliveries", 2, policy.getMaximumRedeliveries());
    assertEquals("Wrong redeliveryDelay", 1000, policy.getRedeliveryDelay());
    assertEquals("Wrong logStackTrace", true, policy.isLogHandled());
    assertEquals("Wrong asyncRedeliveryDelayed", true, policy.isAsyncDelayedRedelivery());
}
Also used : DeadLetterChannelBuilder(org.apache.camel.builder.DeadLetterChannelBuilder) RedeliveryPolicy(org.apache.camel.processor.RedeliveryPolicy)

Example 10 with DeadLetterChannelBuilder

use of org.apache.camel.builder.DeadLetterChannelBuilder in project camel by apache.

the class RouteScopedOnExceptionMultipleRouteBuildersTest method createCamelContext.

@Override
@SuppressWarnings("deprecation")
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = new DefaultCamelContext(createRegistry());
    context.setErrorHandlerBuilder(new DeadLetterChannelBuilder("mock:dead"));
    context.setLazyLoadTypeConverters(isLazyLoadingTypeConverter());
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) DeadLetterChannelBuilder(org.apache.camel.builder.DeadLetterChannelBuilder) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext)

Aggregations

DeadLetterChannelBuilder (org.apache.camel.builder.DeadLetterChannelBuilder)20 JndiRegistry (org.apache.camel.impl.JndiRegistry)16 CamelContext (org.apache.camel.CamelContext)2 Exchange (org.apache.camel.Exchange)1 Processor (org.apache.camel.Processor)1 DefaultErrorHandlerBuilder (org.apache.camel.builder.DefaultErrorHandlerBuilder)1 RouteBuilder (org.apache.camel.builder.RouteBuilder)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 RedeliveryPolicy (org.apache.camel.processor.RedeliveryPolicy)1 Test (org.junit.Test)1