Java 11 migrate remaining e (#1112)
* Moves eip-aggregator to Java 11 * Moves eip-message-channel to Java 11 * Moves eip-publish-subscribe to Java 11 * Moves eip-splitter to Java 11 * Moves eip-wire-tap to Java 11 * Moves event-aggregator to Java 11 * Moves event-asynchronous to Java 11 * Moves event-driven-architecture to Java 11 * Moves event-queue to Java 11 * Moves event-sourcing to Java 11 * Moves execute-around to Java 11 * Moves extension-objects to Java 11
This commit is contained in:
committed by
Ilkka Seppälä
parent
b09b100614
commit
fb2c026822
@@ -27,7 +27,6 @@ import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
/**
|
||||
* Sometimes in enterprise systems there is a need to group incoming data in order to process it as
|
||||
@@ -49,19 +48,17 @@ public class App {
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Run Spring Boot application and obtain ApplicationContext
|
||||
ConfigurableApplicationContext context = SpringApplication.run(App.class, args);
|
||||
var context = SpringApplication.run(App.class, args);
|
||||
|
||||
// Get CamelContext from ApplicationContext
|
||||
CamelContext camelContext = (CamelContext) context.getBean("camelContext");
|
||||
var camelContext = (CamelContext) context.getBean("camelContext");
|
||||
|
||||
// Add a new routes that will handle endpoints form SplitterRoute class.
|
||||
camelContext.addRoutes(new RouteBuilder() {
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
public void configure() {
|
||||
from("{{endpoint}}").log("ENDPOINT: ${body}");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Add producer that will send test message to an entry point in WireTapRoute
|
||||
|
@@ -48,8 +48,6 @@ public class AggregatorRoute extends RouteBuilder {
|
||||
|
||||
/**
|
||||
* Configures the route.
|
||||
*
|
||||
* @throws Exception in case of exception during configuration
|
||||
*/
|
||||
@Override
|
||||
public void configure() {
|
||||
|
@@ -40,8 +40,8 @@ public class MessageAggregationStrategy implements AggregationStrategy {
|
||||
return newExchange;
|
||||
}
|
||||
|
||||
String in1 = (String) oldExchange.getIn().getBody();
|
||||
String in2 = (String) newExchange.getIn().getBody();
|
||||
var in1 = (String) oldExchange.getIn().getBody();
|
||||
var in2 = (String) newExchange.getIn().getBody();
|
||||
|
||||
oldExchange.getIn().setBody(in1 + ";" + in2);
|
||||
|
||||
|
Reference in New Issue
Block a user