spring-integration

Spring Integration enrichHeader with randomUUID

半腔热情 提交于 2020-01-03 20:04:47
问题 I'm a newbie with Spring Integration, using Java 7, and I had this xml configuration before moving to Spring integration DSL, and my application was working to enrich a header with a monitoring ID generated from random UUID (This was to correlate request and response for later searching in logs, maybe this could be done in a different way, don't know): <int:chain input-channel="requestChannel" output-channel="responseChannel"> <int:header-enricher> <int:header name="translator-monitoringId"

How to unit test Spring IntegrationFlow?

微笑、不失礼 提交于 2020-01-03 19:07:10
问题 I have been using Spring Integration DSL to implement some messaging processing flow. How can I actually unit test a single IntegrationFlow, can anyone provide me with an example on how to unit test i.e. transform part of this bean: @Bean public IntegrationFlow transformMessage(){ return message -> message .transform(new GenericTransformer<Message<String>, Message<String>>() { @Override public Message<String> transform(Message<String> message) { MutableMessageHeaders headers = new

Spring Integration SFTP Example with Spring Boot

拟墨画扇 提交于 2020-01-03 15:35:50
问题 We are using the latest Spring Boot for a Spring app and using the latest Spring Integration for SFTP. I've been to the Spring Integration SFTP documentation site, and I took the Spring Boot Configuration as is: @Bean public SessionFactory<LsEntry> sftpSessionFactory() { DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(true); factory.setHost("localhost"); factory.setPort(port); factory.setUser("foo"); factory.setPassword("foo"); factory.setAllowUnknownKeys(true); return new

Spring integration bootstrap - intellij in debug works, packaged jar does not

折月煮酒 提交于 2020-01-03 05:33:16
问题 I'm trying to run same project as packaged jar file and as debug config from intellij. Intellij works fine, but in packaged .jar, it seems integration fails to initialize some channels, leading to Dispatcher has no subscribers for channel 'unknown.channel.name'. This is DEBUG output from working case (you can see that Starting beans in phase 1073741823 is after everything is configured): INFO [2018-02-08 11:54:19,450] org.eclipse.jetty.server.handler.ContextHandler: Started i.d.j

how to dispatch message to channels with int-ftp spring integration?

夙愿已清 提交于 2020-01-03 03:28:04
问题 thanks for attention, i used int-ftp:outbound-gateway to ls command on ftp server , i want to process output channel and dispatch to other channel , my code is: <int:channel id="inbound1"/> <int-ftp:outbound-gateway id="gatewayLS" session-factory="ftpSessionFactory" request-channel="inbound1" command="ls" command-options="-R" expression="payload" reply-channel="output"/> <int:channel id="output"> <int:interceptors> <int:wire-tap channel="logger"/> </int:interceptors> </int:channel> how

Spring Integration fetch paginated results from a REST service

前提是你 提交于 2020-01-03 01:55:29
问题 I'm working on an integration with a REST service, the idea is that it's polled by an outbound gateway marketingCategoryOutboundGateway implemented by HttpRequestExecutingMessageHandler . The gateway makes a request to the REST service and pushes its response to the marketingCategory channel. The gateway itself is triggered by a message created by marketingCategoryPollerMessageSource using the makeTriggeringMessage factory method. The problem is that the service returns paginated results. I

Transaction handling while using message driven channel adapter & service activator

大城市里の小女人 提交于 2020-01-02 16:30:09
问题 I am working on a POC which does the following Uses a message driven channel adapter to recieve message in a transaction Calls the Service Activator which uses a handler to insert the message recieved from the adapter to DB and also post message to outbound channel. Now, if the DB insert of the message fails i want the JMS message returned back to the queue so that it can be re-tried later. With my below configuration it doesnt seems to work.(i.e. even if there is a failure while inserting

Using Spring Boot & Spring Integration with database backed Configuration

折月煮酒 提交于 2020-01-02 10:19:13
问题 For spring boot + integration application, I'm attempting to load configuration from database, allow it to be accessible to Spring's Environment & inject-able via @Value annotation and be override-able by externalized configurations as described in the spring boot reference documentation under the Externalized Configuration Section. The problem I'm having is that my spring Integration XML contains ${input} property placeholders that can not be resolved, because I can't get the database backed

Spring Integration JDBC inbound poller Java Based Configuration

北城余情 提交于 2020-01-02 07:35:10
问题 I want to configure an Inbound pooler with Spring Integration JDBC. So far I have found xml configuration but I want to implement in java configuration. I want to continuously check for changes in db table and I think this is achievable with Spring Integration JDBC. My Db is in different Docker Container and my Application (Spring Boot) is in different Docker Container. I Can not use Hibernate Interceptor here because some other application will edit table. 回答1: Not sure what resources have

Spring Integration as embedded alternative to standalone ESB

大憨熊 提交于 2020-01-02 04:35:10
问题 Does anybody has an experience with Spring Integration project as embedded ESB? I'm highly interesting in such use cases as: Reading files from directory on schedule basis Getting data from JDBC data source Modularity and possibility to start/stop/redeploy module on the fly (e.g. one module can scan directory on schedule basis, another call query from jdbc data source etc.) repeat/retry policy UPDATE: I found answers on all my questions except "Getting data from JDBC data source". Is it