/** * Populate a {@link BridgeHandler} to the current integration flow position. * Typically used with a Java 8 Lambda expression: * <pre class="code"> * {@code * .bridge(s -> s.poller(Pollers.fixedDelay(100)) * .autoStartup(false) * .id("priorityChannelBridge")) * } * </pre> * @param endpointConfigurer the {@link Consumer} to provide integration endpoint options. * @return the current {@link IntegrationFlowDefinition}. * @see GenericEndpointSpec */ public B bridge(Consumer<GenericEndpointSpec<BridgeHandler>> endpointConfigurer) { return register(new GenericEndpointSpec<>(new BridgeHandler()), endpointConfigurer); }
@Override protected MessageHandler createHandler(Object bean, Method method, List<Annotation> annotations) { BridgeHandler handler = new BridgeHandler(); String outputChannelName = MessagingAnnotationUtils.resolveAttribute(annotations, "value", String.class); if (StringUtils.hasText(outputChannelName)) { handler.setOutputChannelName(outputChannelName); } return handler; }
@Override protected MessageHandler createHandler(Object bean, Method method, List<Annotation> annotations) { BridgeHandler handler = new BridgeHandler(); String outputChannelName = resolveTargetBeanName(method); handler.setOutputChannelName(outputChannelName); return handler; }
@Bean @ServiceActivator(inputChannel = "autoCreateChannel") public MessageHandler autoCreateServiceActivator() { return new BridgeHandler(); }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithoutGatherChannel") public MessageHandler auctionWithoutGatherChannelBridge2() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithoutGatherChannel") public MessageHandler auctionWithoutGatherChannelBridge3() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithGatherChannel") public MessageHandler auctionWithGatherChannelBridge1() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel2()); return handler; }
@Bean public BridgeHandler bridgeTarget() { // separate bean so setters and aPS are called BridgeHandler bridgeHandler = new BridgeHandler(); bridgeHandler.setOutputChannel(out()); bridgeHandler.setShouldTrack(true); return bridgeHandler; }
BridgeHandler bridgeHandler = new BridgeHandler(); boolean registerSubflowBridge = false;
@Bean @ServiceActivator(inputChannel = "distributionChannel1") public MessageHandler distributionBridge1() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "distributionChannel3") public MessageHandler distributionBridge3() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithoutGatherChannel") public MessageHandler auctionWithoutGatherChannelBridge1() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "distributionChannel2") public MessageHandler distributionBridge2() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel1()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithGatherChannel") public MessageHandler auctionWithGatherChannelBridge3() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel2()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithGatherChannel") public MessageHandler auctionWithGatherChannelBridge4() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel2()); return handler; }
@Bean @ServiceActivator(inputChannel = "scatterAuctionWithGatherChannel") public MessageHandler auctionWithGatherChannelBridge2() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(serviceChannel2()); return handler; }
@Bean @ServiceActivator(inputChannel = "publishSubscribeChannel") public MessageHandler securedChannelQueueBridge() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(securedChannelQueue()); handler.setOrder(1); return handler; }
@Bean @ServiceActivator(inputChannel = "publishSubscribeChannel") public MessageHandler securedChannelQueue2Bridge() { BridgeHandler handler = new BridgeHandler(); handler.setOutputChannel(securedChannelQueue2()); handler.setOrder(2); return handler; }
IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(producer); BridgeHandler bridgeHandler = new BridgeHandler(); bridgeHandler.setBeanName("bridge");
inbound.setRequestChannel(inChannel); inbound.afterPropertiesSet(); inChannel.subscribe(new BridgeHandler()); inbound.start(); TestingUtilities.waitListening(server, 10000L);