【发布时间】:2016-09-15 15:38:34
【问题描述】:
我在我的项目中使用 ProducerTemplate 并且对性能有些担忧
@Produce
protected ProducerTemplate template;
并用作
String response = template.requestBody("http4://hostToBeCalled/v1/dogs",MESSAGE_BODY,String.class);
在我的例子中,包含组件(http4)的端点在初始化时是未知的,我正在使用生产者模板来解决它。我看到了以这种方式使用模板的问题,因为每次调用 requestBody 时都会创建和销毁 consumer(http4)。
其他人是否也看到了它的潜在性能问题或可以提出更好的解决方案?
【问题讨论】:
-
你能详细解释一下你的用例吗?
标签: apache-camel