spring-integration-dsl

Java mail listener using Spring Integration : mail isn't received by multiple app instances

穿精又带淫゛_ 提交于 2020-06-09 05:19:08
问题 I'm using below code in a Springboot application: @Bean public IntegrationFlow mailListener() { return IntegrationFlows.from(Mail.imapInboundAdapter(receiver()), e -> e.poller(Pollers.fixedRate(60000).maxMessagesPerPoll(-1))) .<Message>handle(message -> logMail(message)).get(); } private org.springframework.messaging.Message<?> logMail(org.springframework.messaging.Message<?> message) { System.out.println("received a mail********** !"); // System.out.println(message.getPayload()); // process

Streaming from remote SFTP directories and sub-directories with Spring Integration

我的未来我决定 提交于 2020-04-17 22:18:31
问题 I am using Spring Integration Streaming Inbound Channel Adapter, to get stream from remote SFTP and parse every lines of content process. I use : IntegrationFlows.from(Sftp.inboundStreamingAdapter(template) .filter(remoteFileFilter) .remoteDirectory("test_dir"), e -> e.id("sftpInboundAdapter") .autoStartup(true) .poller(Pollers.fixedDelay(fetchInt))) .handle(Files.splitter(true, true)) .... And it can work now. But I can only get file from test_dir directory, but I need to recursively get

How to set several message handlers for channel in spring integration DSL?

有些话、适合烂在心里 提交于 2020-02-24 17:00:50
问题 I wrote my first spring integration application which reads data from spring RSS and logs it into console: @Configuration @EnableIntegration @IntegrationComponentScan public class DslConfig { @Bean public IntegrationFlow feedFlow() throws MalformedURLException { return IntegrationFlows.from(inBoundFeedDataAdapter(), configurer -> configurer.poller(Pollers.fixedDelay(1000))) .channel(newsChannel()) .transform(source -> { SyndEntry e = ((SyndEntry) source); return e.getTitle() + " " + e.getLink

How to set several message handlers for channel in spring integration DSL?

僤鯓⒐⒋嵵緔 提交于 2020-02-24 17:00:18
问题 I wrote my first spring integration application which reads data from spring RSS and logs it into console: @Configuration @EnableIntegration @IntegrationComponentScan public class DslConfig { @Bean public IntegrationFlow feedFlow() throws MalformedURLException { return IntegrationFlows.from(inBoundFeedDataAdapter(), configurer -> configurer.poller(Pollers.fixedDelay(1000))) .channel(newsChannel()) .transform(source -> { SyndEntry e = ((SyndEntry) source); return e.getTitle() + " " + e.getLink

How to set several message handlers for channel in spring integration DSL?

夙愿已清 提交于 2020-02-24 16:57:19
问题 I wrote my first spring integration application which reads data from spring RSS and logs it into console: @Configuration @EnableIntegration @IntegrationComponentScan public class DslConfig { @Bean public IntegrationFlow feedFlow() throws MalformedURLException { return IntegrationFlows.from(inBoundFeedDataAdapter(), configurer -> configurer.poller(Pollers.fixedDelay(1000))) .channel(newsChannel()) .transform(source -> { SyndEntry e = ((SyndEntry) source); return e.getTitle() + " " + e.getLink

How to set several message handlers for channel in spring integration DSL?

旧时模样 提交于 2020-02-24 16:57:12
问题 I wrote my first spring integration application which reads data from spring RSS and logs it into console: @Configuration @EnableIntegration @IntegrationComponentScan public class DslConfig { @Bean public IntegrationFlow feedFlow() throws MalformedURLException { return IntegrationFlows.from(inBoundFeedDataAdapter(), configurer -> configurer.poller(Pollers.fixedDelay(1000))) .channel(newsChannel()) .transform(source -> { SyndEntry e = ((SyndEntry) source); return e.getTitle() + " " + e.getLink

Why are ID and TIMESTAMP declared as transient headers in Spring Integration?

天大地大妈咪最大 提交于 2020-02-06 13:28:28
问题 I'm trying to send/receive messages via Spring Integration's AMQP in/outbound adapters and I'm facing this problem. After finding Gary's answer here, I started to investigate if my app sets a message ID correctly. In fact, it's taken care of automatically here. The producer looks like this. I send a wrong message on purpose and at the consumer's end I watch its message transformer fail here. After that the message gets re-queued and re-processed again endlessly. While debugging this issue, I

Why are ID and TIMESTAMP declared as transient headers in Spring Integration?

我的梦境 提交于 2020-02-06 13:27:28
问题 I'm trying to send/receive messages via Spring Integration's AMQP in/outbound adapters and I'm facing this problem. After finding Gary's answer here, I started to investigate if my app sets a message ID correctly. In fact, it's taken care of automatically here. The producer looks like this. I send a wrong message on purpose and at the consumer's end I watch its message transformer fail here. After that the message gets re-queued and re-processed again endlessly. While debugging this issue, I

How to dynamically define file filter pattern for Spring Integration SFTP Inbound Adapter?

社会主义新天地 提交于 2020-01-23 12:05:57
问题 I need to dynamically pull specific files from different directories from different sftp servers to a local server directory of a spring boot application. I store the paths and a file pattern in a postgres database. I got everything working but i don't know how to dynamically define a file filter pattern depending on the remote directory for spring integration sftp inbound adapter so that not all xml files in that specific directory are pulled. I use a RotatingServerAdvice and a

Spring Integration DSL: Dealing with FileSplitter START/END marker payloads

☆樱花仙子☆ 提交于 2020-01-15 05:16:49
问题 I want to setup an integration flow like this: return IntegrationFlows .from("inputChannel") .split(fileSplitter) .handle(this::doStuff1) .handle(this::doStuff2) .handle(this::doStuff3) .aggregate() .handle(this::deleteFile) FileSplitter: @Bean public FileSplitter fileSplitter() { FileSplitter fileSplitter = new FileSplitter(true, true); fileSplitter.setCharset(StandardCharsets.UTF_8); fileSplitter.setApplySequence(true); return fileSplitter; } Input is of type File . The file size is big, so