camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Johansen <thxm...@gmail.com>
Subject Incompatibility in wireTap() between 2.9.0 and 2.9.1/2.9.2
Date Tue, 08 May 2012 14:15:01 GMT
Hi,

There's obviously a difference in how the wireTap()-processor handles
exceptions in 2.9.0 and 2.9.1/2.9.2.
In 2.9.0, when the wireTap() encounters a RejectedExecutionException on its
ExecutorService, the exception is swallowed.
In 2.9.1/2.9.2 the exception is propagated to the errorHandler of the route.
Is this by intention? Makes upgrading kind of difficult for me...

The following test works with 2.9.0 but not 2.9.1/2.9.2:

    @Test
    public void wireTapWithExecutorService() throws Exception {
    CamelContext context = new DefaultCamelContext();
    context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:test").wireTap("mock:test").executorService(createRejectingExecutor());
}
    });
    context.start();
    context.createProducerTemplate().requestBody("direct:test", "TESTING");
    }

    private ExecutorService createRejectingExecutor() {
    ExecutorService executorService = new ThreadPoolExecutor(0, 1, 60,
TimeUnit.SECONDS, new SynchronousQueue<Runnable>());
    executorService.execute(new Runnable() {
    @Override
    public void run() {
    try {
    Thread.sleep(Long.MAX_VALUE);
    } catch (InterruptedException e) {
    }
    }
    });
    return executorService;
    }

Takk,
Thomas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message