spring-integration-dsl

How to use PollerSpec in IntegrationFlowDefinition.bridge() properly with PollerMetadata.DEFAULT_POLLER?

前提是你 提交于 2021-02-11 14:54:27
问题 I am building an integration which has one main flow(start), and 2 sub flows. Main start flow is just to get property information, that is needed for both sub flows. After getting property info, it needs to subscribe different sub flows(startFlow1, startFlow2). And these different sub flows have to work in different times. See the example implementation below; @Bean(name = PollerMetadata.DEFAULT_POLLER) public PollerMetadata poller() { return Pollers.fixedRate(300, TimeUnit.SECONDS, 10).get()

Sprint integration flow won't start

删除回忆录丶 提交于 2021-02-11 13:14:12
问题 This looks like a beginner question to me. For the sake of easy reproduction, I have stripped out virtually all of my logic from this flow. The reason it looks like it does nothing is because it, quite literally, fetches data from a JDBC endpoint and does exactly nothing. setupAdapter = new JdbcPollingChannelAdapter(dbprx.getDatasource(), sql.getSql()); setupAdapter.setRowMapper(rowMapper); StandardIntegrationFlow flow = IntegrationFlows .from(setupAdapter, c -> c.poller(Pollers.fixedRate

Sprint integration flow won't start

余生长醉 提交于 2021-02-11 13:11:25
问题 This looks like a beginner question to me. For the sake of easy reproduction, I have stripped out virtually all of my logic from this flow. The reason it looks like it does nothing is because it, quite literally, fetches data from a JDBC endpoint and does exactly nothing. setupAdapter = new JdbcPollingChannelAdapter(dbprx.getDatasource(), sql.getSql()); setupAdapter.setRowMapper(rowMapper); StandardIntegrationFlow flow = IntegrationFlows .from(setupAdapter, c -> c.poller(Pollers.fixedRate

Sprint integration flow won't start

久未见 提交于 2021-02-11 13:06:56
问题 This looks like a beginner question to me. For the sake of easy reproduction, I have stripped out virtually all of my logic from this flow. The reason it looks like it does nothing is because it, quite literally, fetches data from a JDBC endpoint and does exactly nothing. setupAdapter = new JdbcPollingChannelAdapter(dbprx.getDatasource(), sql.getSql()); setupAdapter.setRowMapper(rowMapper); StandardIntegrationFlow flow = IntegrationFlows .from(setupAdapter, c -> c.poller(Pollers.fixedRate

spring-integration parallel split-route-aggregate flow fails due to one-way MessageHandler

谁都会走 提交于 2021-02-08 06:14:29
问题 I want to process a list of items in parallel by splitting them, routing each item to their appropriate gateway and aggregating the results. However, my application does not start, I get the following error: BeanCreationException: The 'currentComponent' ... is a one-way 'MessageHandler' and it isn't appropriate to configure 'outputChannel'. This is the end of the integration flow. This is a sample flow definition which illustrates the behaviour: @Bean public IntegrationFlow

How to use custom error channel to produce custom error response?

﹥>﹥吖頭↗ 提交于 2021-01-29 16:22:51
问题 I am trying to build a simple API using Spring Integration. For any exceptions or errors thrown in the API, I want to provide custom error responses to client. I am trying with the flow structure below: @Bean public IntegrationFlow mainFlow() { return IntegrationFlows.from(WebFlux.inboundGateway(path) .errorChannel(customErrorChannel()) ) .enrichHeaders(h -> h.header(MessageHeaders.ERROR_CHANNEL, "customErrorChannel")) .transform(p -> { if(<some validation fails>) throw new RuntimeException(

Is Spring Integration Mail IMAP support OAuth2?

耗尽温柔 提交于 2021-01-29 16:15:00
问题 I'm using Spring integration mail for imap idle events. I want to implement a IMAP gmail client using the token instead of using username and password. Is Spring Integration Mail IMAP able to connect to gmail store with access token? Here's the code I used IntegrationFlow flow = IntegrationFlows .from(Mail.imapIdleAdapter("imaps://[username]:[password]@imap.gmail.com:993/inbox") .javaMailProperties(p -> p .put("mail.debug", "false") .autoStartup(false) .shouldReconnectAutomatically(true)

Is there a way to fork the Spring IntegrationFlow using DSL?

[亡魂溺海] 提交于 2021-01-29 04:14:25
问题 I want do something like this where the gateway payload is a String and serviceA & serviceB both return lists. final IntegrationFlow flowA = flow -> flow .handle(serviceA) .handle((payload, headers) -> payload); // List<Object> final IntegrationFlow flowB = flow -> flow .handle(serviceB) .handle((payload, headers) -> payload); // List<Object> return IntegrationFlows .from(myGateway) // String payload .forkAndMerge(flowA, flowB, executor) .handle((payload, headers) -> payload) .get(); Is it

Spring integration: unexpected behavior on error handling in splitter-aggregator flow

青春壹個敷衍的年華 提交于 2021-01-28 21:33:13
问题 I have following failing test. The question is why reply in case of error on one of splitted "sub-messages" is error only, without result for the other, successfully-handled, sub-message (as expected in test)? Is there a modification to this code to achieve result expected in test? @RunWith(SpringRunner.class) public class ErrorHandlingTests { @Autowired StringsService stringsService; interface StringsService { @Nonnull List<String> process(@Nonnull List<String> data); } @EnableIntegration

How to add attachments in mail using spring integration mail with DSL configuration

非 Y 不嫁゛ 提交于 2021-01-28 13:40:31
问题 I am new to Spring integration, trying to send an email with attachment (excel sheet) using spring integration mail dependency with DSL configuration. My problem is I don't know how to add the attachments in Mail.outboundadapter IntegrationFlow . Is anyone having the attachment sample please post it or share some sample code? I have gone through the spring docs, could not understand the attachment concept there.Below is my code. SampleClass.java @EnableAutoConfiguration @SpringBootApplication