spring-integration

How do I create a tcp-inbound-gateway which detects connection loss and auto-reconnects?

别说谁变了你拦得住时间么 提交于 2019-12-22 22:48:09
问题 I'm trying to configure a set of spring-integration components to consume data from a TCP socket. The basic protocol is that upon opening the connection I am prompted for my username, then password, then if authentication succeeds data is streamed to me as it becomes available. A ping message is sent to me every 30 seconds so that I can verify that the connection is alive during quiet periods when no data is streaming. Per the spring-integration docs I have set up a TCP Gateway. http://docs

Spring Integration - transformer and header enricher

戏子无情 提交于 2019-12-22 18:42:03
问题 My case is like this: I need to route a message based on the zipcode to three different stores. For that I need to look at the message header to find the customer's zipcode, and do the following calculation: if(zip < 5000) { store = "SJ"; } else if(zip >= 6000) { store = "JY"; } else { store = "FY"; } I have managed to get it done using the following custom Transformer which I use to enrich the message header: public class HeaderEnricher { public Message<?> transform(Message<?> message) { int

Spring Integration Chain Flow - Handling Void Gateway Calls

扶醉桌前 提交于 2019-12-22 14:08:52
问题 I have a spring integration flow that has a service activator call to a gateway service that has a void result and it seems to hang. It doesn't continue the rest of the chain. Do I need to specify something else to say I don't expect a result return from my gateway call to continue thread execution? I have a void method declaration. Service package foo; import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.handler.annotation.Payload; public

Spring Integration Chain Flow - Handling Void Gateway Calls

ⅰ亾dé卋堺 提交于 2019-12-22 14:08:49
问题 I have a spring integration flow that has a service activator call to a gateway service that has a void result and it seems to hang. It doesn't continue the rest of the chain. Do I need to specify something else to say I don't expect a result return from my gateway call to continue thread execution? I have a void method declaration. Service package foo; import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.handler.annotation.Payload; public

Spring integration outbound-gateway want to use URL as dynamic like

落爺英雄遲暮 提交于 2019-12-22 13:59:03
问题 spring Integration,in outbound-gateway want to use URL as dynamic like <bean id="requestValues" class="com.src.model.RequestValues"/> <int-http:outbound-gateway request-channel="reqChannel" url="${UrlValue}" http-method="${reqmethod}" expected-response-type="java.lang.String" header-mapper="headerMapper" charset="UTF-8" reply-timeout="5000" reply-channel="responseChannel" > <int-http:uri-variable name="UrlValue" expression="#{requestValues.getUrl()}" /> <int-http:uri-variable name="reqmethod"

Spring Integration TCP. Get connection ID of the connected clients

僤鯓⒐⒋嵵緔 提交于 2019-12-22 12:58:25
问题 I have a problem here with the dynamic TCP connection approach (Spring-IP Dynamic FTP Sample). When a message is received, I want to get the TCP connection details for the received message. this way I can keep track in my application of the sender sending that message. But in Service activator I am not able to get this detail. Also need the connection details when my TCP client is connected to the server. This way if the server wants to initiate the communication, it will have the connection

Spring Integration File reading

久未见 提交于 2019-12-22 12:22:25
问题 I am newbie to Spring Integration. I am working on solution, but I am stuck on a specific issue while using inbound file adapter ( FileReadingMessageSource ). I have to read files from different directories and process them and save the files in different directories. As I understand, the directory name is fixed at the start of the flow. Can some one help me on changing the directory name for different requests. I attempted the following. First of all, I am not sure whether it is correct way

Spring Integration File reading

左心房为你撑大大i 提交于 2019-12-22 12:21:36
问题 I am newbie to Spring Integration. I am working on solution, but I am stuck on a specific issue while using inbound file adapter ( FileReadingMessageSource ). I have to read files from different directories and process them and save the files in different directories. As I understand, the directory name is fixed at the start of the flow. Can some one help me on changing the directory name for different requests. I attempted the following. First of all, I am not sure whether it is correct way

Polling S3 bucket for files and processing using spring integration aws

随声附和 提交于 2019-12-22 11:53:05
问题 I need to poll a S3 bucket for files and pick them up and process them as soon as any file becomes available. I need to do this using Spring Integration and spring-integration-aws. So the code i have so far looks like this: public AmazonS3 amazonS3 = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));`enter code here` @Bean public S3InboundFileSynchronizer s3InboundFileSynchronizer() { S3InboundFileSynchronizer synchronizer = new S3InboundFileSynchronizer(amazonS3);

Polling S3 bucket for files and processing using spring integration aws

泪湿孤枕 提交于 2019-12-22 11:51:12
问题 I need to poll a S3 bucket for files and pick them up and process them as soon as any file becomes available. I need to do this using Spring Integration and spring-integration-aws. So the code i have so far looks like this: public AmazonS3 amazonS3 = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));`enter code here` @Bean public S3InboundFileSynchronizer s3InboundFileSynchronizer() { S3InboundFileSynchronizer synchronizer = new S3InboundFileSynchronizer(amazonS3);