@Bean public IntegrationFlow routeMethodInvocationFlow() { return IntegrationFlows.from("routerMethodInput") .route("routingTestBean", "routeMessage") .get(); }
@Bean public IntegrationFlow routeMultiMethodInvocationFlow() { return IntegrationFlows.from("routerMultiInput") .route(String.class, p -> p.equals("foo") || p.equals("bar") ? new String[] { "foo", "bar" } : null, s -> s.suffix("-channel")) .get(); }
@Bean public IntegrationFlow routeMethodInvocationFlow2() { return IntegrationFlows.from("routerMethod2Input") .route(new RoutingTestBean()) .get(); }
@Bean public IntegrationFlow routeFlow() { return IntegrationFlows.from("routerInput") .<Integer, Boolean>route(p -> p % 2 == 0, m -> m.channelMapping(true, "evenChannel") .subFlowMapping(false, f -> f.<Integer>handle((p, h) -> p * 3)) .defaultOutputToParentFlow()) .channel(MessageChannels.queue("oddChannel")) .get(); }
@Bean public IntegrationFlow startFlow() { return IntegrationFlows.from(routerChannel()) .route(payloadTypeRouter()) .get(); }
@Bean @Autowired public IntegrationFlow processProduct(MongoDbFactory mongo) { return IntegrationFlows.from(mongoMessageSource(mongo), c -> c.poller(Pollers.fixedDelay(3, TimeUnit.SECONDS))) .route(Product::isPremium, this::routeProducts) .handle(mongoOutboundAdapter(mongo)) .get(); }
@Bean public IntegrationFlow routeMethodInvocationFlow() { return IntegrationFlows.from("routerMethodInput") .route("routingTestBean", "routeMessage") .get(); }
@Bean public IntegrationFlow myFlow() throws IOException { return IntegrationFlows.from(feedMessageSource()) //4 .<SyndEntry, String> route(payload -> payload.getCategories().get(0).getName(),//5 mapping -> mapping.channelMapping("releases", "releasesChannel") //6 .channelMapping("engineering", "engineeringChannel") .channelMapping("news", "newsChannel")) .get(); // 7 }
@Bean public IntegrationFlow routeMultiMethodInvocationFlow() { return IntegrationFlows.from("routerMultiInput") .route(String.class, p -> p.equals("foo") || p.equals("bar") ? new String[] {"foo", "bar"} : null, s -> s.suffix("-channel")) .get(); }
@Bean public IntegrationFlow routeMethodInvocationFlow2() { return IntegrationFlows.from("routerMethod2Input") .route(new RoutingTestBean()) .get(); }
.route(new StubRunnerIntegrationRouter(entries.getValue(), beanFactory)); beanFactory.initializeBean(builder.get(), flowName); beanFactory.getBean(flowName + ".filter", Lifecycle.class).start();
@Bean public IntegrationFlow xpathFlow(MessageChannel wrongMessagesChannel) { return IntegrationFlows.from("inputChannel") .filter(new StringValueTestXPathMessageSelector("namespace-uri(/*)", "my:namespace"), e -> e.discardChannel(wrongMessagesChannel)) .log(LoggingHandler.Level.ERROR, "test.category", m -> m.getHeaders().getId()) .route(xpathRouter(wrongMessagesChannel)) .get(); }
.route(new StubRunnerMessageRouter(entries.getValue(), beanFactory)); beanFactory.initializeBean(builder.get(), flowName); beanFactory.getBean(flowName + ".filter", Lifecycle.class).start();
@Bean public IntegrationFlow routeFlow() { return IntegrationFlows.from("routerInput") .<Integer, Boolean>route(p -> p % 2 == 0, m -> m.channelMapping(true, "evenChannel") .subFlowMapping(false, f -> f.<Integer>handle((p, h) -> p * 3)) .defaultOutputToParentFlow()) .channel(c -> c.queue("oddChannel")) .get(); }