spring-integration

RequestHandlerRetryAdvice cannot be made to work with Ftp.outboundGateway in Spring Integration

只谈情不闲聊 提交于 2019-12-02 11:42:13
问题 My situation is similar to the one described in this SO question. The difference being that I don't use a WebFlux.outboundGateway but an Ftp.outboundGateway on which I call an AbstractRemoteFileOutboundGateway.Command.GET command, the common problem being that I can't get the defined RequestHandlerRetryAdvice to be used. The configuration looks like this (stripped down to the relevant parts): @RestController @RequestMapping( value = "/somepath" ) public class DownloadController { private

Read CSV file concurrently using Spring Integration

本秂侑毒 提交于 2019-12-02 11:29:55
问题 I would like to process CSV file concurrently using spring integration. Each row will be converted into individual message. So Assuming I am having 10K rows in CSV file , I would like to start 10 Thread , each row will be pass to this Thread. it would be great if anyone show me any sample example. Thanks 回答1: Starting with Spring Integration 4.0 the <splitter> supports Iterator as payload to split. Hence you can convert inbound File to the LineIterator and process messages for each line in

spring xd losing messages when processing huge volume

谁说我不能喝 提交于 2019-12-02 11:11:04
问题 I am using spring xd My stream looks like below and running tests on 3 node container with 1 admin node with rabbit as transport aws-s3|processor1|http-client|processor2>queue:readyQueue I have created below tap. tap1 aws-s3>s3Queue tap2 processor1>processorQueue1 tap3 http-client>httpQueue I run below scenarios in my tests: Scenario1 : 5 files of 200k =1 Million records concurrency of http-client=70 and processor2=30 I see 900k message s3Queue I see 889k message processorQueue1 I see 886k

How to prevent duplicate Spring Integration service activations when polling directory

爷,独闯天下 提交于 2019-12-02 11:01:12
问题 I have a Spring Integration directory poller: <task:executor id="filePollingExecutor" pool-size="1" /> <int:channel id="inboundFilesChannel" datatype="java.io.File" /> <int-file:inbound-channel-adapter id="inboundFilesAdapter" channel="inboundFilesChannel" directory="/my/files/queue" prevent-duplicates="true"> <int:poller id="poller" fixed-delay="1000" max-messages-per-poll="1" task-executor="filePollingExecutor" /> </int-file:inbound-channel-adapter> In response to files appearing in the

In spring integration, how do I catching different exceptions?

主宰稳场 提交于 2019-12-02 10:52:27
In spring integration I have a simple tcp client pipe: a gateway, a tcp outbound gateway a service activator plus an error channel. In the tcp-connection-factory there is a simple interceptor. The error channel very simple, I implemented the tcp-connection-event-inbound-channel-adapter with this filter: org.springframework.integration.ip.tcp.connection.TcpConnectionExceptionEvent. So my error handler very simple,looks like this : public class TcpErrorHandler { public void onException(){ System.out.println("Exception!!! "); } } It works, because when I have a Socket close Exception ( the server

spring amqp-outbound gateway to produce reply from a different thead (Like jms-outbound gateway)

爱⌒轻易说出口 提交于 2019-12-02 10:18:05
Problem statement: Spring amqp-outbound gateway to produce reply from a different thread (Like jms-outbound gateway, having different queue, correlate the request/response using correlation key). Unable to correlate the message with this example. Spring integration <int:gateway id="outboundGateway" service-interface="com.amqp.outbound.gateway.OutboundGateway" default-reply-channel="defaultReplyChannel" > <int:method name="process" request-channel="inboundRequestChannel"/> </int:gateway> <int:channel id="defaultReplyChannel"/> <int:channel id="inboundRequestChannel"/> <int:channel id=

Spring SFTP inbound chanel adapter delete local file

懵懂的女人 提交于 2019-12-02 10:15:49
I have configured spring SFTP to pool the files into local from remote path, to process some jobs, then delete the local & remote file both. below configuration works fine, except the local file delete, i didn't find any configuration to delete the local file, like delete-remote-files="true" <bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory" p:host="${sftp.host}" p:port="${sftp.port}" p:user="${sftp.username}" p:password="${sftp.password}" p:allowUnknownKeys="${sftp.allowUnknownKeys}" /> <int:channel id="sftpChannel"> <int:queue /> <

How to move files using ExpressionEvaluatingRequestHandlerAdvice

烂漫一生 提交于 2019-12-02 10:12:42
In the manual for ExpressionEvaluatingRequestHandlerAdvice, it clearly says, A typical use case for this advice might be with an <ftp:outbound-channel-adapter/>, perhaps to move the file to one directory if the transfer was successful, or to another directory if it fails . But I cannot figure out expression to move payload from current directory to another one. This example just deletes or renames the file: <bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice"> <property name="onSuccessExpression" value="payload.delete()" /> <property name=

S3: Outbound adapter to place file in multiple target buckets

泄露秘密 提交于 2019-12-02 10:11:12
have a spring boot application, where I am trying to place a file into multiple S3 bucket using single S3 outbound adapter.. Would like to know if its possible to place the file in multiple bucket using single outbound adapter using spring-integration-aws itself( without using aws -sdk) Any suggestion will be helpful. S3 : Outbound adapter: <int-aws:s3-outbound-channel-adapter id="filesS3Mover" channel="filesS3MoverChannel" transfer-manager="transferManager" bucket="${aws.s3.target.bucket}" key-expression="headers.targetsystem-folder/headers.file_name" command="UPLOAD"> </int-aws:s3-outbound

Spring Integration: Get rid of code duplication for setting up beans

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 09:42:26
For my SFTP client project, I am using spring integration. We have different clients and have to connect to different SFTP servers, but, all of the logic is same, so I have abstracted them out into AbstractSFTPEndPoint. Each client-specific class implements getClientId(), which is used by AbstractSFTPEndPoint to get client-specific details like SFTP credentials. However, the entire logic is same for all the clients, but I am still having to implement specific classes for each client. This is mainly because we need separate "MessageSource" for each client. How can I get rid of this duplication?