Closed syedyusufh closed 3 days ago
Was going to suggest another workaround:
.channel("notObserved")
and
@EnableIntegrationManagement(observationPatterns = "!notObserved")
or
@EnableIntegrationManagement(observationPatterns ={ "!notObserved", "*" })
But that does not work: the first one just ignores everything else. The second one ends up with a sort in HashSet
, where *
got lower hash, therefore it comes first in a matching loop 😄 .
Will raise separate issue and fix. Nothing related for this yet.
Here is that issue: https://github.com/spring-projects/spring-integration/issues/9260.
BTW, feel free to contribute fixes: https://github.com/spring-projects/spring-integration/blob/main/CONTRIBUTING.adoc
So, our logic for the reactive reply from this kind of components is like Mono.toFuture()
.
And looks like there is no Reactor context propagation in there down to the CompletableFuture
consumer.
Thinking...
I have made the fix and now your sample application is OK:
2024-06-28T11:49:18.915-04:00 INFO 31944 --- [ scheduling-1] [667edb7e9be7aa6059b96f78bc67c011-ae124118f96ecbd9] o.s.integration.handler.LoggingHandler : ----------------------START-------------------------
2024-06-28T11:49:18.919-04:00 INFO 31944 --- [ scheduling-1] [667edb7e9be7aa6059b96f78bc67c011-50473877464ebff9] o.s.integration.handler.LoggingHandler : WebClient GET Request (start of reactorContext)
2024-06-28T11:49:18.978-04:00 INFO 31944 --- [ scheduling-1] [667edb7e9be7aa6059b96f78bc67c011-8ae480e6d77503b6] c.i.sample.config.TracingConfig : Request Headers: [Content-Type:"application/json", traceparent:"00-667edb7e9be7aa6059b96f78bc67c011-8ae480e6d77503b6-01"]
2024-06-28T11:49:19.640-04:00 INFO 31944 --- [ctor-http-nio-3] [667edb7e9be7aa6059b96f78bc67c011-8ae480e6d77503b6] c.i.sample.config.TracingConfig : Response Headers: [Access-Control-Allow-Origin:"*", Alt-Svc:"h3=":443"; ma=2592000", Content-Type:"application/json", Date:"Fri, 28 Jun 2024 15:49:19 GMT", Server:"Caddy", Vary:"Accept-Encoding", Transfer-Encoding:"chunked"]
2024-06-28T11:49:19.667-04:00 ERROR 31944 --- [oundedElastic-1] [667edb7e9be7aa6059b96f78bc67c011-f0b19daa83cd9fd5] .o.WebFluxRequestExecutingMessageHandler : Failed to send async reply: org.springframework.integration.support.MessageBuilder@21b720b4
Will issue Pull Request shortly.
Forgot to mention.
Now you don't need ec -> ec.customizeMonoReply((message, mono) -> mono.contextCapture())
since it is done in the framework by itself.
Thanks for the quick fix.
ReactorContext
is NOT carried onto the following Imperative processing and this results in a new ObservationContext (change in traceId)SO reference - https://stackoverflow.com/questions/78653090/spring-integration-restore-reactorcontext-into-imperative-processing
Issue happening with Spring Boot v3.3.0