spring-integration

Spring Integration DSL - Outbound Gateway with access to Headers

三世轮回 提交于 2019-12-10 06:25:32
问题 I'm having an issue with Spring Integration. I'm using Spring Boot 1.4.0.RELEASE, Spring Integration 4.3.1.RELEASE, Spring Integration DSL 1.2.0.M1. What I'm trying to do: I'm writing an application that will read files from FTP and local file system (using inbound channel adapters), transfer the files to a local working directory (using file outbound gateways), process, then move them to a final destination (file outbound gateway/adapters). EDIT: The original issue stemmed from incorrect

Spring integration move file after processing

痞子三分冷 提交于 2019-12-09 22:36:48
问题 How to move a file after processing in spring integration after processing file ..? I have followed http://xpadro.blogspot.com/2016/07/spring-integration-polling-file.html to implement the file polling , but I need to add onSuccess and OnError transnational events (with out XML configurations) 回答1: I am not sure what you mean by "transaction", file systems are generally not transactional, but you can add an advice to the final consumer in the flow... @SpringBootApplication public class

usage of spring integration's schema validator?

三世轮回 提交于 2019-12-09 08:08:26
I am new to spring integration. i have below requirement. poll the folder(file system) get the XML file validate against XSD if it is invalid move it to different folder. if it is valid then invoke service activator which will send the xml file as an input to rest ful web service. I have below code: <int-file:inbound-channel-adapter auto-create-directory="true" channel="contentChannel" id="inBoundChannelAdapter" directory="${someFolder}" prevent-duplicates="true"> <int:poller max-messages-per-poll="1" fixed-rate="10000"/> </int-file:inbound-channel-adapter> <int:channel id="contentChannel"/>

Moving processed files in remote S(ftp) using Java DSL

我们两清 提交于 2019-12-09 01:06:16
问题 I'm trying to move files on remote SFTP once the batch has successfully processed the files using Spring integration and Java DSL. What would be the best way to achieve that? Adding a step in batch to move remote files ? Or using FTP Outbound Gateway and provide the MV command ? I tend to prefer the second solution and let the batch focus on the logic only, but I've hard times trying to implement it with java dsl. I've read http://docs.spring.io/spring-integration/reference/html/ftp.html#ftp

Spring Integration - how to keep the orginal payload and use it later?

怎甘沉沦 提交于 2019-12-08 19:45:54
问题 I would like to keep the original payload of the original requests and ise it in a xslt-transformer or in other operation. I lose it because I use an xslt-transformer and I need just some of the elements in the transformation. So my scenario is: 1.inbound-gateway (incoming WS req) -> 2.xslt-transformer (mapping for calling an external WS) -> 3.outbound-gateway (calling the external WS) -> 4.xslt-transformer (creating response from the resp. of the external WS and the original req) At the 4th

how to dispatch message to channels with int-ftp spring integration?

匆匆过客 提交于 2019-12-08 17:40:29
thanks for attention, i used int-ftp:outbound-gateway to ls command on ftp server , i want to process output channel and dispatch to other channel , my code is: <int:channel id="inbound1"/> <int-ftp:outbound-gateway id="gatewayLS" session-factory="ftpSessionFactory" request-channel="inbound1" command="ls" command-options="-R" expression="payload" reply-channel="output"/> <int:channel id="output"> <int:interceptors> <int:wire-tap channel="logger"/> </int:interceptors> </int:channel> how proccess output channel and dispatch to other channel for example input1 and input2? 来源: https:/

Spring Retry Junit: Testing Retry template with Custom Retry Policy

南楼画角 提交于 2019-12-08 13:11:33
问题 I'm trying to test a Retry template which is using a custom Retry Policy. In order to do that, I'm using this examples: https://github.com/spring-projects/spring-retry/blob/master/src/test/java/org/springframework/retry/support/RetryTemplateTests.java#L57 Basically, my goal is to test my retry logic when I got some specific http error status (for example an http 500 error status). This is the xml context for my junit: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www

Logging process in Spring Integration without using xml files

岁酱吖の 提交于 2019-12-08 12:24:31
问题 My goal here is to log time of a process without using xml files for configurations. By reading other posts I came up with enriching headers in the integration flow. This kinda works, but not for the right purpose. For every new started process it gives me a startTime when the application is launched (i.e. a constant). See below: @Bean public IntegrationFlow processFileFlow() { return IntegrationFlows .from(FILE_CHANNEL_PROCESSING) .transform(fileToStringTransformer()) .enrichHeaders(h -> h

int-event:inbound-channel-adapter not working when there is java.net.ConnectException: Connection refused: connect

北战南征 提交于 2019-12-08 11:58:22
问题 I went through this post and implemented eventListner. Best practice for handling low-level socket error in spring integration? I have implemented Spring TCP channels as below: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-ip="http://www.springframework.org/schema/integration/ip" xmlns:context="http://www

How to implement enricher using spring integraton java DSL?

六眼飞鱼酱① 提交于 2019-12-08 11:15:25
问题 I want to rewrite following xml sample using java DSL xml config: <int:channel id="findUserServiceChannel"/> <int:channel id="findUserByUsernameServiceChannel"/> <!-- See also: https://docs.spring.io/spring-integration/reference/htmlsingle/#gateway-proxy https://www.enterpriseintegrationpatterns.com/MessagingGateway.html --> <int:gateway id="userGateway" default-request-timeout="5000" default-reply-timeout="5000" service-interface="org.springframework.integration.samples.enricher.service