spring-integration

Re-queue Amqp message at tail of Queue

[亡魂溺海] 提交于 2019-12-13 05:16:42
问题 I have a project setup using Spring and RabbitMQ. Currently it is possible for my application to receive an amqp message that cannot be processed until another asynchronous process has completed (legacy and totally detached, i have no control). So the result is i may have to wait on processing a message for some amount of time. The result of this is an exception in a transformer. When the message is NACK'd back to rabbitMQ it is putting it back into the head of the queue and re-pulling it

Spring Integration - custom errorChannel - only first exception gets logged

偶尔善良 提交于 2019-12-13 04:36:01
问题 This is a follow up to the previous question (requirements given in original question). Spring Integration - Filter - Send messages to a different end point My issue is that if there is more than one error in the input file, only the first error is getting logged. The subsequent errors are not getting logged. Modified code: @Configuration public class CreateUserConfiguration { @Bean public IntegrationFlow createUser() { return IntegrationFlows.from(Files.inboundAdapter(new File(INPUT_DIR)))

Spring integration Logging message channel ID

孤街醉人 提交于 2019-12-13 04:23:15
问题 I am using <logging-channel-adapter logger-name="feedlogger" level="INFO" log-full-message="true"/> to log full messages using log4j framework. Is there any way to log the 'id' of each and every message channel, used in spring intergration flow, in the log file? Thanks, Mitesh 回答1: The question is not clear. Channels are beans and if you would like to get their ids logged, there is just enough to turn on a info for the org.springframework and bean ids will be logged on the application start

FileSystemAcceptOnceFilelistFilter is not working

Deadly 提交于 2019-12-13 03:46:15
问题 Have a spring boot application which routes file from source path to target path. Trying to run more than one instance of application pointing to same source path. Expecting only one instance should process a file and once processed it will be deleted from source. Same file should not be processed by other instance. Since file nio locker is not working, as suggested consider to use a FileSystemPersistentAcceptOnceFileListFilter based on the shared ConcurrentMetadataStore() -

Spring Integration + SpringBoot JUnit tries to connect to DB unexpectedly

[亡魂溺海] 提交于 2019-12-13 03:45:02
问题 Please refer to system diagram attached. system diagram here ISSUE: When I try to post message to input channel, the code tries to connect to the DB and throws an exception that it is unable to connect. Code inside 5 -> Read from a channel, apply Business Logic (empty for now) and send the response to another channel. @Bean public IntegrationFlow sendToBusinessLogictoNotifyExternalSystem() { return IntegrationFlows .from("CommonChannelName") .handle("Business Logic Class name") // Business

spring-integration-aws dynamic file download

旧巷老猫 提交于 2019-12-13 03:43:22
问题 I've a requirement to download a file from S3 based on a message content. In other words, the file to download is previously unknown, I've to search and find it at runtime. S3StreamingMessageSource doesn't seem to be a good fit because: It relies on polling where as I need to wait for the message. I can't find any way to create a S3StreamingMessageSource dynamically in the middle of a flow. gateway(IntegrationFlow) looks interesting but what I need is a gateway(Function<Message<?>,

Service Activator Handlers not running serially

限于喜欢 提交于 2019-12-13 03:43:05
问题 I am unable to get the service activator handlers run serially, they don't seem to run one after the other. In the below code, the fileWriterMessageHandler method is called before the fileUpload method. What is the standard return value that the fileUpload needs to return? @Bean public IntegrationFlow inboundChannelFlow(@Value("${file.poller.delay}") long delay, @Value("${file.poller.messages}") int maxMsgsPerPoll, TaskExecutor taskExecutor, MessageSource<File> fileSource) { return

Programmatically create multiple connections for TcpNetClientConnectionFactory

蹲街弑〆低调 提交于 2019-12-13 03:42:06
问题 Continuing the conversation from this question: Two-part question here: Can a TcpNetClientConnectionFactory have multiple connections to its upstream server, if the host and port are the same? If so, how can I programmatically build a new connection for that connection factory? I see the buildNewConnection method, but it is protected. The first connection is automatically built as soon as the first Message passes through the factory. What we need to do is notice when following Messages have a

Buffering Spring integration publish-subscribe channel

走远了吗. 提交于 2019-12-13 03:38:40
问题 I have a spring integration application that has a pub-sub channel with two subscribers - one publishes the message to Kafka and the other writes the message to a file. The problem is that the service-activator that writes the message to the file is not able to keep up with the speed of the other service-activator that produces to Kafka. This causes a slow down in the overall message processing rate. To overcome this, I have added an extra layer in between the pub-sub channel and the service

Spring integration service activator with multiple messages

家住魔仙堡 提交于 2019-12-13 03:30:03
问题 I would like to process multiple messages at a time e.g. get 10 messages from the channel at a time and write them to a log file at once. Given the scenario, can I write a service activator which will get messages in predefined set i.e. 5 or 10 messages and process it? If this is not possible then how to achieve this using Spring Integration. 回答1: That is exactly what you can get with the Aggregator. You can collect several messages to the group using simple expression like size() == 10 .