admin管理员组文章数量:1392003
It looks like a new version of the Apache camel route; process methods are removed.
We are in the upgrade process from camel 3.24 to 4.4
Could anyone help me refactor the older camel route code below into a new camel version?
Thank you!
rest()
.tag("Test")
.post("/Vendor/receive")
.route()
.process(new RetrieveAccessToken(_logger))
.toD("rest endpoint url" + "?bridgeEndpoint=true&connectionClose=true&httpMethod=POST")
.process(exchange -> {
_logger.info("rest service completed for MessageType<" + getMessageType(exchange) + ">", getLogEvent(exchange));
});
could not find any online help
It looks like a new version of the Apache camel route; process methods are removed.
We are in the upgrade process from camel 3.24 to 4.4
Could anyone help me refactor the older camel route code below into a new camel version?
Thank you!
rest()
.tag("Test")
.post("/Vendor/receive")
.route()
.process(new RetrieveAccessToken(_logger))
.toD("rest endpoint url" + "?bridgeEndpoint=true&connectionClose=true&httpMethod=POST")
.process(exchange -> {
_logger.info("rest service completed for MessageType<" + getMessageType(exchange) + ">", getLogEvent(exchange));
});
could not find any online help
Share Improve this question edited Mar 12 at 22:31 Hilory 2,1577 gold badges14 silver badges30 bronze badges asked Mar 12 at 15:18 anba rajendrananba rajendran 1 1- Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Bot Commented Mar 13 at 6:39
1 Answer
Reset to default 0Please refer this, Camel route()
and endRest()
methods have been Removed from RestDefition class, so you may need to break the above code to use to("direct:endpointName")
instead.
If you break down your existing code to something like below, it should work.
rest()
.tag("Test")
.post("/Vendor/receive")
.to("direct:a");
from("direct:a")
.process(new RetrieveAccessToken(_logger))
.to("direct:b");
from("direct:b")
.toD("rest endpoint url" + "?bridgeEndpoint=true&connectionClose=true&httpMethod=POST")
.process(exchange -> {
_logger.info("rest service completed for MessageType<" + getMessageType(exchange) + ">", getLogEvent(exchange));
});
本文标签: Apache Camel routeprocess method refactorStack Overflow
版权声明:本文标题:Apache Camel route, process method refactor - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744745288a2622839.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论