spring-integration-dsl

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

Return connection status for TCP adapter with Server Connection factory/Client Connection Factory

强颜欢笑 提交于 2019-12-13 02:01:18
问题 I want to check the status of the TCP Adapter(Client/Server connection factory) whether the adapter is connected or not. This Question is posted in continuation with this Question but with some other issue. After changing the method name : from: isConnected() to isClientModeConnected() I have to change my control Bus Bean definition Earlier no output channel is configured hence its giving error @Bean public IntegrationFlow controlBus() { return IntegrationFlowDefinition::controlBus; } Now,

Give Priority to SFTP Remote Directories

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 01:44:04
问题 Using single SFTP channel I need to process two remote directories lowpriority and highprioiry but lowpriority files pick after the highpriority . please let know how handle multiple directories in SFTP inbound adapter with single channel ? We can do using https://docs.spring.io/spring-integration/reference/html/sftp.html#sftp-rotating-server-advice Rotation Service advice in Spring 5.1.2 Release but what about 4.3.12 Release.? 回答1: It is not available in 4.3.x; the feature was added in 5.0.7

Spring integration DSL Scatter-Gather async/parallel execution for multiple recipientFlows

旧巷老猫 提交于 2019-12-13 00:08:19
问题 we are trying to make parallel calls to different recipient using scatter-gather and it works fine. But the second recipient flow is not starting unless the first one is complete(traced in Zipkin). is there is a way to make all recipients async.. very similar to split-aggregate with executor channel. public IntegrationFlow flow1() { return flow -> flow .split().channel(c -> c.executor(Executors.newCachedThreadPool())) .scatterGather( scatterer -> scatterer .applySequence(true) .recipientFlow

Spring Integration Wrong Host Header

[亡魂溺海] 提交于 2019-12-12 05:49:06
问题 We've been experiencing this weird problem with the request Host header being set as the application's URL. This results to the external system to not handle our requests. Here's the DEBUG log of apache of the Spring Integration application hosted on localhost:8082 . Don't mind the content for now but the Content-Type will be a problem subsequently: org.apache.http.wire - http-outgoing-0 >> "POST /health HTTP/1.1[\r][\n]" org.apache.http.wire - http-outgoing-0 >> "Accept: */*[\r][\n]" org

Spring integration: preserve http error code and body in response

允我心安 提交于 2019-12-12 04:38:55
问题 I have an inbound http gateway whose incoming message is passed to an outbound http gateway (using integration java dsl). When the outbound gateway response has http status 200, the outbound response goes back to the caller of the inbound gateway as expected. But when the outbound gateway responds with specific client errors like 423 locked or 403 forbidden, the caller of the inbound gateway receives 500 and a body message that contains an exception as String. I understand that this is

How to use SpEL to read payload and header content in a Spring Integration Router

情到浓时终转凉″ 提交于 2019-12-11 21:29:36
问题 Technologies in my project Spring Boot 2 Spring Integration (XML style) Java 8 Tomcat 9.x/Liberty 19.0.0.1 As a part of my Spring Integration project (REST API with an inbound-http-gateway, that takes an XML input and produces an XML output), I am writing the following components: A service-activator that performs basic validation of the incoming XML against its XSD. If validation is successful, a POJO (a builder-pattern Java object) is built with a Boolean instance variable/property called

Echo socket service in Spring Integration DSL using Channels and Gateways

筅森魡賤 提交于 2019-12-11 19:15:51
问题 This is variant of my question How to implement simple echo socket service in Spring Integration DSL. A good working solutions was introduced but I would like to explore alternatives. Particularly I am interested in solution based on using inbound and outbound channels explicitly, in client and server implementations. Is that possible? So far I was able to come up with: HeartbeatClientConfig ... @Bean public IntegrationFlow heartbeatClientFlow( TcpNetClientConnectionFactory

How to pass header using wireTap?

主宰稳场 提交于 2019-12-11 17:18:54
问题 Now I have following flow: flow -> flow.channel(some_channel()) ..... .gateway(anotherFlow, idempotentByHeader(OBJECT_ID_HEADER)); Consumer<GatewayEndpointSpec> idempotentByHeader(String objectIdHeader) { return endpointSpec -> endpointSpec.advice(idempotentByHeaderInterceptor(objectIdHeader)).errorChannel(errorChannel()); } default IdempotentReceiverInterceptor idempotentByHeaderInterceptor(String header) { MessageProcessor<String> headerSelector = message -> headerExpression(header).apply

ExpressionEvaluatingRequestHandlerAdvice sends message to both success and fail channel in case of SpelException

*爱你&永不变心* 提交于 2019-12-11 14:57:56
问题 I had asked few doubts in the comments section of this thread. While debugging the application I noticed some possible code errors. Are they bugs or features? In ExpressionEvaluatingRequestHandlerAdvice::evaluateSuccessExp‌​ression , the exception is thrown after AdviceMessage is sent to SuccessChannel . This causes Exception payload in it. Shouldn't the method first throw the exception if there is one? In the same class, propagateOnSuccessEvaluationFailures is 'false' by default which causes