spring-integration

Spring Integration: how to unit test a poller advice

安稳与你 提交于 2020-08-12 02:54:25
问题 I'm trying to unit test an advice on the poller which blocks execution of the mongo channel adapter until a certain condition is met (=all messages from this batch are processed). The flow looks as follow: IntegrationFlows.from(MongoDb.reactiveInboundChannelAdapter(mongoDbFactory, new Query().with(Sort.by(Sort.Direction.DESC, "modifiedDate")).limit(1)) .collectionName("metadata") .entityClass(Metadata.class) .expectSingleResult(true), e -> e.poller(Pollers.fixedDelay(Duration.ofSeconds

Spring integration Handle Connection Close event with Event Listener and Re establish it while using Dynamic TCP Routing

心已入冬 提交于 2020-08-06 06:11:08
问题 I am using spring integration to create flow for request / response architecture and also receiving arbitrary data from server. Until this stage, i checked examples from spring-integration github and advices from @Gary Russell and @Artem Bilan. Here is my gateway interface @Component @MessagingGateway(defaultRequestChannel = "toTcp.input") public interface ToTCP { byte[] send(String data, @Header("host") String host, @Header("port") int port, @Header("irregularMessageChannelName") String

How to config tcp server to receive data from multiple client using spring boot?

你离开我真会死。 提交于 2020-07-20 03:44:52
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

折月煮酒 提交于 2020-07-20 03:44:50
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

大兔子大兔子 提交于 2020-07-20 03:44:46
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

How to config tcp server to receive data from multiple client using spring boot?

安稳与你 提交于 2020-07-20 03:44:04
问题 I would like to configure TCP server to receive and reply data from multiple clients. I searched many other thread but could not found exact way to do. I'm using spring integration first time and have no experience. Server requirement should be able to receive and reply data to specific client (can have multiple client, each client should processed separately) should be able to send data to client and wait for response for specific timeout. Should be able to detect client is disconnect or not

Spring Integration Gateway VS Adapters

余生长醉 提交于 2020-07-08 03:46:37
问题 Hello I am new on spring integration I checked examples for Spring Integration dynamic routing. Finally ı found it in here Dynamic TCP Client In here there were lines @Component @MessagingGateway(defaultRequestChannel = "toTcp.input") public interface TcpClientGateway { byte[] send(String data, @Header("host") String host, @Header("port") int port); } private MessageChannel createNewSubflow(Message<?> message) { String host = (String) message.getHeaders().get("host"); Integer port = (Integer)

Free queue channel in spring integration with java DSL

与世无争的帅哥 提交于 2020-07-03 09:39:30
问题 i have a channel that stores messages. When new messages arrive, if the server has not yet processed all the messages (that still in the queue), i need to clear the queue (for example, by rerouting all data into another channel). For this, I used a router. But the problem is when a new messages arrives, then not only old but also new ones rerouting into another channel. New messages must remain in the queue. How can I solve this problem? This is my code: @Bean public IntegrationFlow

how can i connect with different SFTP server dynamically?

时光毁灭记忆、已成空白 提交于 2020-06-29 04:29:10
问题 i am using spring integration to move a file from SFTP to local directory. i am able to move files from one sftp server to local, i have 3 4 sftp servers, first i thought about writing different classes for each SFTP server, after my research i found that we can use delegating sessionfactory for setting more than one SFTP using java. i read the documentation but i couldn't implement that. anybody can help me with that. i am adding my code below. @Configuration @EnableIntegration public class

Java Mail Listner : This email server does not support RECENT or USER flags

谁说胖子不能爱 提交于 2020-06-29 04:25:08
问题 This is a continuation of Java mail listener using Spring Integration : mail isn't received by multiple app instances . I'm using below ImapMailReceiver code : @Bean public ImapMailReceiver receiver() { ImapMailReceiver receiver = new ImapMailReceiver( "imaps://username:pwd@mail.company.com/INBOX"); receiver.setShouldMarkMessagesAsRead(false); receiver.setSimpleContent(true); receiver.setUserFlag("test-flag"); //receiver.setJavaMailProperties(javaMailProperties()); return receiver; } My