有可能从Java方法调用Camel Route的XML吗?

huangapple go评论61阅读模式
英文:

Is it possible to call a Camel Route xml from Java method?

问题

尝试从Java方法调用Camel路由XML。能否在同一个方法中进行调用并返回?

英文:

I am trying to call a camel route xml from the Java method. Is it possible to call and return to the same method again?

答案1

得分: 1

是的,您可以使用ProducerTemplate来实现这一点。

如果您的调用方必须等待路由完成,您的路由必须是同步执行的(例如direct 路由)。有关更多细节,请参阅交换模式

如果您期望从路由中获得响应,您应该使用生产者模板的其中一个request* 方法(而不是send* 方法)。

英文:

Yes, you can use a ProducerTemplate for that.

If your caller has to wait for the route to complete, your route must be executed synchronously (for example direct routes). See exchange pattern for more details.

If you expect a response from the route you should use one of the request* methods of the producer template (not the send* methods).

huangapple
  • 本文由 发表于 2020年5月5日 14:32:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/61607070.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定