Hello!
I'm trying to create multiple listeners to one vm queue in different camel
contexts. My code looks like this:
public class VMTest
{
public static void main(String[] args) throws InterruptedException,
Exception
{
final CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder()
{
@Override
public void configure()
{
from("vm:eventQueue?multipleConsumers=true").to("stream:out");
}
});
context.start();
final CamelContext context2 = new DefaultCamelContext();
context2.addRoutes(new RouteBuilder()
{
@Override
public void configure()
{
from("vm:eventQueue?multipleConsumers=true").to("stream:out");
}
});
context2.start();
ProducerTemplate producerTemplate =
context.createProducerTemplate();
producerTemplate.sendBody("vm:eventQueue?multipleConsumers=true",
"the message");
Thread.sleep(5000);
}
}
I expect message to be sent to each configured listeners. Unfortunately,
only one message is occurred in the console. Is it possible to consume a vm
queue from different contexts? Thanks!
--
View this message in context:
http://camel.465427.n5.nabble.com/VM-queue-for-2-camel-context-tp5485770p5485770.html
Sent from the Camel - Users mailing list archive at Nabble.com.