spring-integration

@Router in Spring Integration with annotations (request/reply)

ぐ巨炮叔叔 提交于 2020-01-15 04:00:23
问题 Could you provide any example for routing messages in Spring Integration?. Filter by payload message, header or something like the following: <int:payload-type-router input-channel="routingChannel"> <int:mapping type="java.lang.String" channel="channel1" /> <int:mapping type="java.lang.Integer" channel="channel2" /> </int:payload-type-router> How the response works? I mean, if I send: channel -> router -> transformer -> gateway Simple but I am looking something similar to this example: <int

Spring Integration Bridge with poller not working as expected for JMS

て烟熏妆下的殇ゞ 提交于 2020-01-15 03:37:24
问题 Using spring-integration 5.0.7 to throttle the bridging of msgs between two JMS queues. The docs at: https://docs.spring.io/spring-integration/docs/5.0.7.RELEASE/reference/html/messaging-channels-section.html#bridge-namespace suggest: <int:bridge input-channel="pollable" output-channel="subscribable"> <int:poller max-messages-per-poll="10" fixed-rate="5000"/> </int:bridge> But schema validator complains "no nested poller allowed for subscribable input channel" on bridge elt. But, if I put the

Spring integration inbound-gateway Fire an event when queue is empty

空扰寡人 提交于 2020-01-15 03:37:09
问题 I'm a newbie around but I'll try to be consice. {INPUT QUEUE}->[INBOUND-GATEWAY-1]-->[ROUTER]----------->(ACTIVATOR)<--------------- \ / \-->{HOLD QUEUE}--->[INBOUND-GATEWAY-2]--^ I'm having an scenario in which I have to dynamically change routing conditions in a flow like the former. Messages comming from a queue are sent to an activator to be processed, or another queue to be put on hold. At certain time, I have to close INBOUND-GATEWAY-1 so no new messages come into the flow, and open

Example Spring integration DSL for JPA Inbound Channel adapter

别等时光非礼了梦想. 提交于 2020-01-14 13:53:46
问题 I can't find a useful example for polling a JPA source for inbound data. I know how to do this in XML but can't figure out how do it in DSL. In short what I want to do is periodically poll a JPA repository for records then put the records into a flow that will do the usual filtering/transforming/executing. Kind regards David Smith 回答1: Wire up a JpaPollingChannelAdapter as a @Bean and use IntegrationFlows.from(jpaMessageSource(), c -> c.poller(Pollers.fixedDelay(1000))) .transform(...) ...

Spring Integration: get all headers involved in an aggration and not just the last one

℡╲_俬逩灬. 提交于 2020-01-14 04:21:06
问题 I have a Spring integration flow defined like this: IntegrationFlows.from(Amqp.inboundAdapter(connectionFactory, "queueName") .id("id") .acknowledgeMode(MANUAL) .autoStartup(autoStartup) .concurrentConsumers(2) .maxConcurrentConsumers(3) .messageConverter(messageConverter())) .aggregate(a -> ...) .handle(serviceActivatorBean, "myMethod", e -> e.advice(requestHandlerRetryAdviceForIntegrationFlow())) .get(); And a service activator defined like this: @Component @Transactional public class

Spring Integration DSL History issue

本小妞迷上赌 提交于 2020-01-14 02:59:17
问题 I have to setup the flows dynamically. Example: @Component @Slf4j public class FTPFlow { @Autowired private IntegrationFlowContext integrationFlowContext; @EventListener(ApplicationReadyEvent.class) public void setup(){ integrationFlowContext.registration(flow()).register(); } public IntegrationFlow flow() { DefaultFtpSessionFactory defaultFtpSessionFactory = new DefaultFtpSessionFactory(); defaultFtpSessionFactory.setHost("localhost"); defaultFtpSessionFactory.setPort(252);

REST endpoints in Spring Integration make messaging channels multithreaded

你说的曾经没有我的故事 提交于 2020-01-13 19:45:28
问题 I have a very simple Spring Boot application, which provides a couple of restful endpoints and this is supposed to drive a sftp file being uploaded to a sftp server. My requirement is that if there is more than one file, the files should be queued. I expected to achieve this with the default behaviour of the sftp spring integration workflow, as i read that DirectChannel automatically queues files. To test the behaviour I do the following: Send a big file, blocking the channel for a while by

How to create a Spring Reactor Flux from Http integration flow?

蓝咒 提交于 2020-01-11 10:53:26
问题 I have a question very similar to this one How to create a Spring Reactor Flux from a ActiveMQ queue? With one difference that messages come from Http endpoint rather than JMS queue. The problem is that Message Channel is not get populated for some reason or it is not picked up by Flux.from(). The log entries show that GenericMessage is created from Http Integration flow with a payload as path variable but does not get enqueued/published to a channel? I tried .channel(MessageChannels.queue())

How to create a Spring Reactor Flux from Http integration flow?

微笑、不失礼 提交于 2020-01-11 10:53:06
问题 I have a question very similar to this one How to create a Spring Reactor Flux from a ActiveMQ queue? With one difference that messages come from Http endpoint rather than JMS queue. The problem is that Message Channel is not get populated for some reason or it is not picked up by Flux.from(). The log entries show that GenericMessage is created from Http Integration flow with a payload as path variable but does not get enqueued/published to a channel? I tried .channel(MessageChannels.queue())

Spring Integration : How to guarantee the transaction two more jdbc-outbound-gateway?

梦想的初衷 提交于 2020-01-09 11:31:26
问题 I have the following pattern I have two kinds of databases. One is a internal database where it saves data from 5 json datas from http inbound gateways. The Other is a external database where it saves final refiend data from 5 jsons saved tables. The Process is like the followings. One Transaction ① Each message is saved to each table and return status to the client where it sends data. Second Transaction ② If 5 kinds of datas are completed to receive, it activate one service activator where