spring-integration

Remote partition - slave getting greedy

醉酒当歌 提交于 2019-12-02 02:45:43
Following is what we are trying to achieve. We want a big xml file to be staged in a database parallely in different vms. To achieve this, we are using the scalable spring batch remote partition approach and we are running into some issues. Following is the high level setup master - splits an xml file into multiple partitions ( we currently have a grid size of 3). slave 1 - processing partitions (reads index based partitions and writes to DB) slave 2 - processing partitions We are running it in Linux and with active MQ 5.15.3. With the above setup slave 1 is processing 2 partitions at the same

How to retry a failed call to a Webflux.outboundgateway in Spring integration

和自甴很熟 提交于 2019-12-02 02:43:26
问题 I have a spring integration flow defined in the flow DSL syntax. One of my handlers is a Webflux.outboundGateway. When the remote URI is not accessible, an exception is thrown and sent to the "errorChannel". I'm trying to have the flow to retry, but so far with no success (the call is never retried). Here is what my configuration looks like: @Bean public IntegrationFlow retriableFlow() { return IntegrationFlows .from(...) .handle( WebFlux.outboundGateway(m -> UriComponentsBuilder

Conditional retry advice in a Spring Integration message flow?

风流意气都作罢 提交于 2019-12-02 02:26:31
I have a http gateway call that's occasionally returning 503 errors. I'd like to configure retry advice around that call, but I don't want to do it for every error, just the 503s. <int-http:outbound-gateway ... errorHandler="..."> <int-http:request-handler-advice-chain> <int:retry-advice max-attempts="3" /> </int-http:request-handler-advice-chain> </int-http:outbound-gateway> I already have a custom error handler configured that filters statuses (ex: 404) that I don't want to treat as errors, but I don't see an obvious way to control how the advice is applied based on what I can do in the

spring integration sftp mainframe :failed to write file; nested exception is 3: Permission denied

*爱你&永不变心* 提交于 2019-12-02 01:31:16
I am trying to sft file to mainframe using spring integration sftp:outbound-gateway: this is configuration: <sftp:outbound-gateway id="putGateway" session-factory="sftpSessionFactory" request-channel="sftpFileInputChannel" command="put" expression="payload" remote-directory="${remote.upload.directory}" remote-filename-generator-expression="'${remote.upload.filename}'" use-temporary-file-name="false" reply-channel="replayFromPutSftpChannel"/> where remote.upload.filename.credit.fmpl=/!DTS4.UP.G3TRF.S60304 remote.upload.directory=/ I am getting exception like : Caused by: org.springframework

Spring Integration with Jackson ObjectMapper and Java 8 Time (JSR-310)

倖福魔咒の 提交于 2019-12-02 01:08:18
I am struggling with configuring a "custom" ObjectMapper to be used by the Spring Integration DSL transformers. I receive an java.time.Instant json representations that I would like to parse to object properties. i.e: {"type": "TEST", "source":"TEST", "timestamp":{"epochSecond": 1454503381, "nano": 335000000}} The message is a kafka message which raises a question: Should I write a custom serializer implementing Kafka encoders/decoders in order to be able to transform the kafka message to the right object or spring-integration have to do this automatically? fw/dependencies and version: Spring

Connect to Microsoft Exchange Server with Spring Integration Mail

随声附和 提交于 2019-12-02 00:42:23
I want to connect to Microsoft Exchange 2010 with IMAP using Spring Integration Mail. My question is how the connection string exactly look like. Let's say: domain=earth user=jdoe email=jon.doe@earth.com Folder=inbox As far as I know, MS Exchange only supports imaps for connection to. My Spring integration config looks like this: <util:properties id="javaMailProperties"> <prop key="mail.imaps.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> <prop key="mail.imaps.socketFactory.fallback">false</prop> <prop key="mail.store.protocol">imaps</prop> <prop key="mail.debug">true</prop> </util

How should I build my Messages in Spring Integration?

孤街浪徒 提交于 2019-12-01 23:31:10
I have an application I coded which I am refactoring to make better use of Spring Integration. The application processes the contents of files. The problem (as I see it) is that my current implementation passes Files instead of Messages , i.e. Spring Integration Messages . In order to avoid further rolling my own code, which I then have to maintain later, I'm wondering if there is a recommended structure for constructing Messages in Spring Integration. What I wonder is if there is some recommended combination of channel with something like MessageBuilder that I should use. Process/Code

How to create Spring Integration Flow from two MessageProducerSpec?

廉价感情. 提交于 2019-12-01 22:43:30
I am using Spring Integration, Java DSL (release 1.1.3) I have my org.springframework.integration.dsl.IntegrationFlow defined as follows return IntegrationFlows.from(messageProducerSpec) .handle(handler) .handle(aggregator) .handle(endpoint) .get(); } messageProducerSpec is instance of org.springframework.integration.dsl.amqp.AmqpBaseInboundChannelAdapterSpec I would like my integration flow to consume messages from TWO separate messageProducerSpecs (two separate SimpleMessageListenerContainers , each using diffrent ConnectionFactory ). How is it possible to construct integrationFlow from more

Error handling in Spring integration flow async

自闭症网瘾萝莉.ら 提交于 2019-12-01 20:24:18
I have the following Spring Integration configuration that allows me to call a gateway method from MVC Controller and letting controller return, while integration flow will continue on its own in a separate thread that does not block controller. However, I cannot figure out how to get my error handler to work for this async flow. My gateway has error channel defined, but my exceptions do not reach it for some reason. Instead, I see that LoggingHandler gets invoked. @Bean IntegrationFlow mainInteractiveFlow() { return IntegrationFlows.from( MessageChannels.executor("input", executor)) .split()

Move files from one directory to another when request coming from another system

六月ゝ 毕业季﹏ 提交于 2019-12-01 14:23:28
I want to use read files in one directory and move to another directory, I am using spring-integration for this. I want to execute the task(move files to output directory) when request coming from another system. I do not want to run file mover repeatedly, Is there a way to do this in Spring Integration? Thank you in advance, Udeshika Gary Russell There are some tricks you can do with pollers, such as the FireOnceTrigger I mentioned in this answer . But in this case, probably the simplest solution is, instead of using an inbound adapter, define a <bean/> of type FileReadingMessageSource in