use of org.apache.camel.component.sjms.support.MyAsyncComponent in project camel by apache.
the class AsyncTopicProducerTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
context.addComponent("async", new MyAsyncComponent());
from("direct:start").to("mock:before").to("log:before").process(new Processor() {
public void process(Exchange exchange) throws Exception {
beforeThreadName = Thread.currentThread().getName();
}
}).to("async:bye:camel").process(new Processor() {
public void process(Exchange exchange) throws Exception {
afterThreadName = Thread.currentThread().getName();
}
}).to("sjms:topic:foo?synchronous=false");
from("sjms:topic:foo").to("mock:after").to("log:after").delay(1000).process(new Processor() {
public void process(Exchange exchange) throws Exception {
route += "B";
sedaThreadName = Thread.currentThread().getName();
}
}).to("mock:result");
}
};
}
use of org.apache.camel.component.sjms.support.MyAsyncComponent in project camel by apache.
the class AsyncConsumerFalseTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
camelContext.addComponent("async", new MyAsyncComponent());
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useJmx=false");
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.camel.component.sjms.support.MyAsyncComponent in project camel by apache.
the class AsyncConsumerInOutTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
camelContext.addComponent("async", new MyAsyncComponent());
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useJmx=false");
SjmsComponent component = new SjmsComponent();
component.setConnectionFactory(connectionFactory);
camelContext.addComponent("sjms", component);
return camelContext;
}
use of org.apache.camel.component.sjms.support.MyAsyncComponent in project camel by apache.
the class AsyncQueueProducerTest method createRouteBuilder.
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
context.addComponent("async", new MyAsyncComponent());
from("direct:start").to("mock:before").to("log:before").process(new Processor() {
public void process(Exchange exchange) throws Exception {
beforeThreadName = Thread.currentThread().getName();
}
}).to("async:bye:camel").process(new Processor() {
public void process(Exchange exchange) throws Exception {
afterThreadName = Thread.currentThread().getName();
}
}).to("sjms:queue:foo?synchronous=false");
from("sjms:queue:foo?synchronous=false").to("mock:after").to("log:after").delay(1000).process(new Processor() {
public void process(Exchange exchange) throws Exception {
route += "B";
sedaThreadName = Thread.currentThread().getName();
}
}).to("mock:result");
}
};
}
Aggregations