@Bean @InboundChannelAdapter(channel = "out") public MaxFetchSource source1() { return new MaxFetchSource(); }
@InboundChannelAdapter(channel = "results") @Bean public MessageSource<Integer> testingMessageSource() { return MockIntegration.mockMessageSource(1, 2, 3); }
@InboundChannelAdapter(value = "fooChannel", poller = @Poller(trigger = "onlyOnceTrigger", maxMessagesPerPoll = "2")) public String foo() { return "foo"; }
@Bean @InboundChannelAdapter("serviceChannel") @Profile("foo") public MessageSource<?> skippedMessageSource() { return () -> new GenericMessage<>("foo"); }
@Bean @InboundChannelAdapter(value = "routerChannel", autoStartup = "false", poller = @Poller(fixedRate = "10", maxMessagesPerPoll = "1", errorChannel = "counterErrorChannel")) public Supplier<Integer> counterMessageSupplier(final AtomicInteger counter) { return counter::incrementAndGet; }
@Bean @InboundChannelAdapter(value = "routerChannel", autoStartup = "false", poller = @Poller(fixedRate = "10", maxMessagesPerPoll = "1", errorChannel = "counterErrorChannel")) public MessageSource<Integer> counterMessageSource(final AtomicInteger counter) { return () -> new GenericMessage<>(counter.incrementAndGet()); }
@Bean @InboundChannelAdapter(value = "fluxChannel", poller = @Poller(fixedDelay = "100", maxMessagesPerPoll = "3", taskExecutor = "taskExecutor")) public Supplier<Integer> counterMessageSupplier() { return () -> { int i = counter().incrementAndGet(); return i % 2 == 0 ? i : null; }; }
@Bean("eipSource.source") @EndpointId("eipSource") @InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000")) public MessageSource<?> source() { return () -> null; }
@InboundChannelAdapter(channel = "lateBindingChannel", autoStartup = "false", poller = @Poller(fixedDelay = "100")) @Bean public MessageSource<String> autoCreatedChannelMessageSource() { return () -> new GenericMessage<>("bar"); }
@InboundChannelAdapter(channel = "noAutoAck", poller = @Poller(fixedDelay = "100"), autoStartup = "false") @Bean public MessageSource<?> noAutoAckSource() { return new AmqpMessageSource(connectionFactory(), NOAUTOACK_QUEUE) { @Override protected AbstractIntegrationMessageBuilder<Object> doReceive() { AbstractIntegrationMessageBuilder<Object> builder = super.doReceive(); if (builder != null) { Config.this.requeueLatch.countDown(); } return builder; } }; }
@EndpointId("eipMethodSource") @InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000")) public String pojoSource() { return null; }
@InboundChannelAdapter(channel = "in", poller = @Poller(fixedDelay = "100"), autoStartup = "false") @Bean public MessageSource<?> source() { return new AmqpMessageSource(connectionFactory(), QUEUE_WITH_DLQ); }
@Bean @InboundChannelAdapter(value = "flow1.input", autoStartup = "false", poller = @Poller(fixedRate = "100")) public MessageSource<?> integerMessageSource() { MethodInvokingMessageSource source = new MethodInvokingMessageSource(); source.setObject(new AtomicInteger()); source.setMethodName("getAndIncrement"); return source; }
@Bean @InboundChannelAdapter(channel = "stream", autoStartup = "false") public MessageSource<InputStream> sftpMessageSource() { SftpStreamingMessageSource messageSource = new SftpStreamingMessageSource(template(), Comparator.comparing(LsEntry::getFilename)); messageSource.setFilter(new AcceptAllFileListFilter<>()); messageSource.setRemoteDirectory("sftpSource/"); return messageSource; }
@Bean @InboundChannelAdapter(value = "fooChannel", poller = @Poller(fixedDelay = "5000")) public MessageSource<?> storedProc() { StoredProcPollingChannelAdapter source = new StoredProcPollingChannelAdapter(storedProcExecutor()); source.setExpectSingleResult(true); return source; }
@Bean @InboundChannelAdapter(value = "aggregateChannel", poller = @Poller(fixedDelay = "1000", maxMessagesPerPoll = "10")) public MessageSource<Object> fromJms() { JmsDestinationPollingSource source = new JmsDestinationPollingSource(new JmsTemplate(connectionFactory)); source.setDestinationName("splitterAggregator"); return source; }
@InboundChannelAdapter(value = "messageChannel", poller = @Poller(fixedDelay = "${poller.interval}", maxMessagesPerPoll = "1")) public Message<?> message() { return MessageBuilder.withPayload("bar").setHeader("foo", "FOO").build(); }
@Bean @InboundChannelAdapter(channel = "stream", autoStartup = "false") public MessageSource<InputStream> ftpMessageSource() { FtpStreamingMessageSource messageSource = new FtpStreamingMessageSource(template(), Comparator.comparing(FTPFile::getName)); messageSource.setFilter( new FtpPersistentAcceptOnceFileListFilter( new SimpleMetadataStore(metadataMap()), "testStreaming")); messageSource.setRemoteDirectory("ftpSource/"); return messageSource; }
@InboundChannelAdapter(value = "counterChannel", autoStartup = "false", phase = "23") public @interface MyInboundChannelAdapter {
@Bean @InboundChannelAdapter(value = Source.SAMPLE, poller = @Poller(fixedDelay = "1000", maxMessagesPerPoll = "1")) public MessageSource<String> timerMessageSource() { return new MessageSource<String>() { public Message<String> receive() { logger.info("******************\nAt the Source\n******************"); String value = "{\"value\":\"hi\"}"; logger.info("Sending value: " + value); return MessageBuilder.withPayload(value).build(); } }; }