spring-integration

Sprint integration flow won't start

久未见 提交于 2021-02-11 13:06:56
问题 This looks like a beginner question to me. For the sake of easy reproduction, I have stripped out virtually all of my logic from this flow. The reason it looks like it does nothing is because it, quite literally, fetches data from a JDBC endpoint and does exactly nothing. setupAdapter = new JdbcPollingChannelAdapter(dbprx.getDatasource(), sql.getSql()); setupAdapter.setRowMapper(rowMapper); StandardIntegrationFlow flow = IntegrationFlows .from(setupAdapter, c -> c.poller(Pollers.fixedRate

Spring Integration - Log time taken for whole file processing

我们两清 提交于 2021-02-11 05:01:57
问题 I have a scenario to split a large files to small chunks using File Inbound, Splitter, Transformer and File Outbound adapter. I would like to know how long it took to process the file starting from read to split to write back. How do I achieve this functionality? Any help is appreciated. <file:inbound-channel-adapter directory="/Documents" filename-pattern="test.txt" channel="inputFiles"> <int:poller fixed-delay="0"/> </file:inbound-channel-adapter> <int:channel id="inputFiles"> <int

How to implement a keep alive connection on a TCP connection using spring integration?

﹥>﹥吖頭↗ 提交于 2021-02-10 18:44:44
问题 I've a TCP client which was built using spring integration TCP and the server supports a keep alive message (ping/pong style). The connections were configured using a CachingClientConnectionFactory and I'd like to take advantage on this server feature. Here's my bean configuration: private static final int SERIALIZER_HEADER_SIZE = 2; /** * Serializer used by connection factory to send and receive messages */ @Bean public ByteArrayLengthHeaderSerializer byteArrayLengthHeaderSerializer() {

Spring Aws Kinesis Binder Acquiring and Releasing lock issues in Dynamo DB while consuming messages

蓝咒 提交于 2021-02-10 16:18:49
问题 Sometimes, when we are stopping the application abruptly exception occurs that unlocking has been failed. Then the same group will never gets the messages. Other groups are getting messages. I am using the aws kinesis binder snapshot version. This is the error, when application is stopped. 2018-07-19 22:21:21.371 ERROR 60981 --- [s-shard-locks-1] a.i.k.KinesisMessageDrivenChannelAdapter : Error during unlocking: DynamoDbLock [lockKey=aaaa:myStream:shardId-000000000000,lockedAt=2018-07-19@22

http outbound retry with conditions (For checker condition)

隐身守侯 提交于 2021-02-10 04:50:09
问题 I want to make http outbound gateway call with retry condition. The outbound gateway will retry until the rest API that i have return ERROR or COMPLETE. What i do is: <int-http:outbound-gateway request-channel="checkJobChannel" url="http://host/rest/job-status" http-method="GET" extract-request-payload="true" expected-response-type="java.lang.String" reply-timeout="10000" reply-channel="checkJobChannel.reply" auto-startup="true" transfer-cookies="true"> then the router @Router(inputChannel =

Spring Integration Gateway with no arguments

老子叫甜甜 提交于 2021-02-08 13:34:05
问题 On my gateway, I have a method @Gateway String commsTest(); The idea is that I can call commsTest from the bean and use spring integration to wire it up to the service activator that will check comms. When I do that I get a receive is not supported, because no pollable reply channel has been configured error. I realise that this is because a method with no params means "I am trying to poll a message from the channel" This is a two part question. What does it mean to poll a message from the

Spring Batch Integration - pass data b/w integration and batch

China☆狼群 提交于 2021-02-08 12:01:23
问题 I am using Spring Batch Integration as I have to perform certain works before invoking the batch. I have done the work using Spring Integration and invoke the batch using job-launching-gateway and it works like a charm. Now the question is how to pass the data from Spring Integration to Batch? Suggestions please. 回答1: The message sent to the JobLaunchingGateway has a JobLaunchRequest payload. When you build the request in your Spring Integration flow, you can add JobParameters which are then

Spring Batch Integration - pass data b/w integration and batch

这一生的挚爱 提交于 2021-02-08 12:01:11
问题 I am using Spring Batch Integration as I have to perform certain works before invoking the batch. I have done the work using Spring Integration and invoke the batch using job-launching-gateway and it works like a charm. Now the question is how to pass the data from Spring Integration to Batch? Suggestions please. 回答1: The message sent to the JobLaunchingGateway has a JobLaunchRequest payload. When you build the request in your Spring Integration flow, you can add JobParameters which are then

Proper ultimate way to migrate JMS event listening to Spring Integration with Spring Boot

眉间皱痕 提交于 2021-02-08 10:25:22
问题 I got a JmsConfig configuration class that handles JMS events from a topic in the following way: It defines a @Bean ConnectionFactory , containing an ActiveMQ implementation It defines a @Bean JmsListenerContainerFactory instantiating a DefaultJmsListenerContainerFactory and passing it through Boot's DefaultJmsListenerContainerFactoryConfigurer It defines a @Bean MessageConverter containing a MappingJackson2MessageConverter and setting a custom ObjectMapper I use @JmsListener annotation

Spring integration - imap - credentials issue

核能气质少年 提交于 2021-02-08 10:20:17
问题 Here is my xml: <mail:inbound-channel-adapter id="imapAdapter" store-uri="imaps://[avita.nir@gmail.com]:[secretPass]@imap.gmail.com/INBOX" channel="recieveEmailChannel" should-delete-messages="false" should-mark-messages-as-read="true" auto-startup="true" java-mail-properties="javaMailProperties"> For some reason when i type this "store-uri" i get this exception (null password): DEBUG: protocolConnect returning false, host=gmail.com], user=[avita.nir, password=<null> 21 יול 2013 15:32:05