spring-integration

Routing to a different channels based on condition

[亡魂溺海] 提交于 2019-12-24 09:05:40
问题 I would like to route the message to different channels based on the condition of the property. Let's say I have score property. If the score is <100 then it goes to "perfectchannel" else it goes to "normalchannel" Where do I specify the spel expression or condition <si:router id="serviceRouter" input-channel="serviceRoutingChannel" expression="payload.score" default-output-channel="badchannel" resolution-required="false"> <si:mapping value="100" channel="perfectchannel" /> <si:mapping value=

Wrap spring integration outbound gateway calls with hystrix command

荒凉一梦 提交于 2019-12-24 08:47:35
问题 I want to wrap the call to outbound gateway in my integration application using hystrix command similar to how it is available in Spring boot application. <int-http:outbound-gateway id="outbound.gateway" request-channel="get.request.channel" url="http://localhost:9090/profileapplication" http-method="GET" charset='UTF-8' reply-channel="reply.channel" > </int-http:outbound-gateway> I have my outbound gateway as above. I need this for a scenario where the target application is frequently down

Issues implementing spring-integration-aws

陌路散爱 提交于 2019-12-24 08:38:32
问题 I'm using spring integration aws to poll an S3 resource and get files from the S3 bucket and process them using spring integration. Below is what i have : AmazonS3 amazonS3 = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey)); @Bean IntegrationFlow fileReadingFlow() { return IntegrationFlows .from(s3InboundFileSynchronizingMessageSource(), e -> e.poller(p -> p.fixedDelay(30, TimeUnit.SECONDS))) .handle(receiptProcessor()) .get(); } @Bean public S3InboundFileSynchronizer

Dynamically provide directory and file name to ftp outbound gateway

核能气质少年 提交于 2019-12-24 08:31:26
问题 We have a requirement for the FTP client to download a file whose name and directory is provided at run-time. So, the FTP client may be asked to download file1.txt from foo1/foo2 directory path on the remote server. We do have a solution using Spring Integration FTP outbound gateway. With this solution to make it dynamic: the ApplicationContext for the gateway is created the gateway properties get set using file name and remote directory path the file is downloaded the ApplicationContext is

Same file gets picked up again and again in spring-ftp but with different names

邮差的信 提交于 2019-12-24 07:56:19
问题 I have a spring input channel defined like this <file:inbound-channel-adapter prevent-duplicates="false" id="inpChannel" directory="file:/Users/abhisheksingh/req" auto-startup="true"> <int:poller id="poller" fixed-delay="1000" /> </file:inbound-channel-adapter> <int:service-activator input-channel="inpChannel" ref="inpHandler" /> The file name example as TEST.SQQ. SQQ is the file format which the client uses to place the files in ftp. However, I see that the same file is picked up by the

How do I convert this spring-integration configuration from XML to Java?

感情迁移 提交于 2019-12-24 07:46:42
问题 This particular piece makes sense to implement in the application rather than XML because it is a constant across the entire cluster, not localized to a single job. From dissecting the XSD, it looks to me like the xml for int-kafka:outbound-channel-adapter constructs a KafkaProducerMessageHandler. There is no visible way to set the channel, the topic, or most of the other attributes. Note to potential downvoters - (rant on) I have been RTFM'ing for a week and am more confused than when I

Http inbound adapter gives empty response on OPTIONS request under CORS

感情迁移 提交于 2019-12-24 07:38:50
问题 In my development environment I'm using two separate technology stacks for the frontend and the backend: React + webpack-dev-server for the frontend, served at localhost:8081 Spring for the backend, serving HTTP endpoints over localhost:7080 , in two ways: using integration for the data processing (reception, transformation and storage), this processing starts at an http:inbound-channel-adapter (see the following XML configuration) using MVC to provide a read-only (i.e. GET-only) access

Spring Batch Integration job-launching-gateway

戏子无情 提交于 2019-12-24 07:06:51
问题 I am working on simple project that will lunch a job when a new file is created in specific folder but i don't want to use xml only java annotation , so my question is how can i implement the below in code <batch-int:job-launching-gateway request-channel="outboundJobRequestChannel" reply-channel="jobLaunchReplyChannel"/> <int:logging-channel-adapter channel="jobLaunchReplyChannel"/> BR Shahbour 回答1: Use the Spring Integration Java DSL; in your case, you would use ... .handle(jobLauncher())

Spring Integration Inbound-channel-adapter: make one poll and exit

孤人 提交于 2019-12-24 06:39:29
问题 I need to make a small Spring Integration application that synchronize a table from a JDBC source to another one, and I just need to launch that script just once in a while. I'd like to make one poll from the inbound channel adapter (wait that the message flow through the chain) and exit the application. I couldn't find any obvious way to do that: any suggestions? 回答1: @Steve suggests correct solution. You should make your <poller> with some long fixed-delay do not start a new polling task.

What is the java config equivalent to tcp-outbound-gateway?

陌路散爱 提交于 2019-12-24 05:26:09
问题 I have the following spring-integration XML config <ip:tcp-outbound-gateway id="outboundClient" request-channel="requestChannel" reply-channel="string2ObjectChannel" connection-factory="clientConnectionFactory" request-timeout="10000" reply-timeout="10000"/> How can I write the Java config equivalent of the above? I thought the equivalent would be @Bean public TcpOutboundGateway outboundClient() { TcpOutboundGateway tcpOutboundGateway = new TcpOutboundGateway(); tcpOutboundGateway