admin管理员组文章数量:1394099
I have two routes in Apache Camel where parent route is calling child route with enrich component. enrich doesnt share Unit of Work (Exchange) by default, but I need that because of sharing variables in ExchangeVariableRepository. So I try to use setting shareUnitOfWork for that. But variable is not shared and exchange Id for parent and child route is different.
Here is my code:
from("direct:importCsv")
.log("importCsv: Exchange: ${exchangeId}")
.enrich()
.constant("direct:GetHeadOfficeIdStep")
.shareUnitOfWork()
from("direct:GetHeadOfficeIdStep")
.log("GetHeadOfficeIdStep: Exchange: ${exchangeId}")
This produce these logs:
2025-03-12 06:45:49,496 INFO [...] (vert.x-worker-thread-13) importCsv: Exchange: 8E006DC89BB640F-0000000000000000
2025-03-12 06:45:49,497 INFO [...] (vert.x-worker-thread-13) GetHeadOfficeIdStep: Exchange: 8E006DC89BB640F-0000000000000001
Exchange Id is different for parent and child route ...
本文标签: shareUnitOfWork of Apache Camel enrich component doesnt workStack Overflow
版权声明:本文标题:shareUnitOfWork of Apache Camel enrich component doesnt work - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744729233a2621946.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论