Grokbase Groups Camel users June 2016
FAQ
Hi

What version of Camel are you using?
On Sat, Jun 11, 2016 at 5:21 PM, Darrell King wrote:
Hi,
I have a context scoped onCompletion() that sends to RabbitMQ. When Camel
is shutdown it doesn't close the connection to RabbitMQ. If the
onCompletion() is route scoped the connection is closed.

This test shows the problem. I expect the SendProcessor to be shutdown when
the CamelContext is shutdown but it's state is started=true. Am I doing
something wrong ?

public class RabbitMQProducerOnCompletionShutdownIntTest extends
CamelTestSupport {
private static final String EXCHANGE = "ex1";
private static final String COMPLETION_URI =
String.format("rabbitmq:localhost:5672/%s?routingKey=%s&username=cameltest&password=cameltest&skipQueueDeclare=true",
EXCHANGE, "routeCompletion");

@Produce(uri = "direct:start")
protected ProducerTemplate template;

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
onCompletion().to(COMPLETION_URI);
from("direct:start").to("direct:end");
}
};
}

@Test
public void contextScopedOnCompletionProcessorShouldBeShutdown()
throws Exception {
OnCompletionProcessor p1 = (OnCompletionProcessor)
context().getProcessor("onCompletion1");
context().stop();
// Expect that the sendProcessor with id="to1"
(p1.processor.processor.nextProcessor) is shutdown:
// but is is not
}
}


--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
groupusers @
categoriescamel
postedJun 11, '16 at 3:21p
activeJun 12, '16 at 8:03a
posts4
users2
websitecamel.apache.org

2 users in discussion

Claus Ibsen: 2 posts Daknin: 2 posts

People

Translate

site design / logo © 2017 Grokbase