Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Processor;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
Expand Down Expand Up @@ -99,7 +100,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
public void configure() throws Exception {

from("direct:rabbitMQ").id("producingRoute").setHeader("routeHeader", simple("routeHeader"))
.inOut(rabbitMQEndpoint);
.to(ExchangePattern.InOut, rabbitMQEndpoint);

from(rabbitMQEndpoint).id("consumingRoute").log("Receiving message").process(new Processor() {
public void process(Exchange exchange) throws Exception {
Expand Down Expand Up @@ -132,7 +133,7 @@ public void process(Exchange exchange) throws Exception {
});

from("direct:rabbitMQNoAutoAck").id("producingRouteNoAutoAck").setHeader("routeHeader", simple("routeHeader"))
.inOut(noAutoAckEndpoint);
.to(ExchangePattern.InOut, noAutoAckEndpoint);

from(noAutoAckEndpoint).id("consumingRouteNoAutoAck").to(resultEndpoint)
.throwException(new IllegalStateException("test exception"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
Expand Down Expand Up @@ -61,7 +62,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {

@Override
public void configure() throws Exception {
from("direct:rabbitMQ").id("producingRoute").log("Sending message").inOnly(rabbitMQEndpoint)
from("direct:rabbitMQ").id("producingRoute").log("Sending message").to(ExchangePattern.InOnly, rabbitMQEndpoint)
.to(producingMockEndpoint);
from(rabbitMQEndpoint).id("consumingRoute").log("Receiving message").to(consumingMockEndpoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.camel.CamelExecutionException;
import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
Expand Down Expand Up @@ -67,7 +68,7 @@ protected RouteBuilder createRouteBuilder() throws Exception {
public void configure() throws Exception {
from("direct:rabbitMQ").id("producingRoute").onException(AlreadyClosedException.class, ConnectException.class)
.maximumRedeliveries(10).redeliveryDelay(500L).end()
.log("Sending message").inOnly(rabbitMQEndpoint).to(producingMockEndpoint);
.log("Sending message").to(ExchangePattern.InOnly, rabbitMQEndpoint).to(producingMockEndpoint);
from(rabbitMQEndpoint).id("consumingRoute").log("Receiving message").to(consumingMockEndpoint);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
Expand Down Expand Up @@ -50,11 +51,11 @@ protected RouteBuilder createRouteBuilder() throws Exception {

@Override
public void configure() throws Exception {
from("direct:rabbitMQ").id("producingRoute").log("Sending message").inOnly(rabbitMQEndpoint)
from("direct:rabbitMQ").id("producingRoute").log("Sending message").to(ExchangePattern.InOnly, rabbitMQEndpoint)
.to(producingMockEndpoint);

from(rabbitMQEndpoint).onException(Exception.class).handled(true).end().id("consumingRoute")
.log("Receiving message").inOnly(consumingMockEndpoint)
.log("Receiving message").to(ExchangePattern.InOnly, consumingMockEndpoint)
.throwException(new Exception("Simulated handled exception"));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
Expand Down Expand Up @@ -83,10 +84,11 @@ protected RouteBuilder createRouteBuilder() {

@Override
public void configure() {
from("direct:rabbitMQ").id("producingRoute").log("Sending message").inOnly(rabbitMQEndpoint)
from("direct:rabbitMQ").id("producingRoute").log("Sending message").to(ExchangePattern.InOnly, rabbitMQEndpoint)
.to(producingMockEndpoint);

from(rabbitMQEndpoint).id("consumingRoute").log("Receiving message").inOnly(consumingMockEndpoint)
from(rabbitMQEndpoint).id("consumingRoute").log("Receiving message")
.to(ExchangePattern.InOnly, consumingMockEndpoint)
.throwException(new Exception("Simulated exception"));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
Expand Down Expand Up @@ -50,11 +51,12 @@ protected RouteBuilder createRouteBuilder() throws Exception {

@Override
public void configure() throws Exception {
from("direct:rabbitMQ").id("producingRoute").log("Sending message").inOnly(rabbitMQEndpoint)
from("direct:rabbitMQ").id("producingRoute").log("Sending message")
.to(ExchangePattern.InOnly, rabbitMQEndpoint)
.to(producingMockEndpoint);

from(rabbitMQEndpoint).onException(Exception.class).handled(false).end().id("consumingRoute")
.log("Receiving message").inOnly(consumingMockEndpoint)
.log("Receiving message").to(ExchangePattern.InOnly, consumingMockEndpoint)
.throwException(new Exception("Simulated unhandled exception"));
}
};
Expand Down