I want to share a variable or object, amongst spring integration components such that once the flow reaches splitter, after that the variable/object should be accessible for each splitted flow. Please suggest how can we do it??
The best way to do that in the Messaging stateless world is headers. So you should use a HeaderEnricher
to store your object in the custom header before splitting. This way all the splitted items will get the same headers. But you should keep in mind if your object is mutable, any changes in any item process will affect all other items. Just because the object is the same.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.