作为一个无关紧要的拙见,我发现apache camel docs太过冒昧,因为假设读者已经有了骆驼的背景。
通常情况下,Web服务提供商是生产者,其生产的服务的客户是消费者。
让我们看一下http://camel.apache.org/pojo-producing.html。
其中说,有两种不同的方法可以向Camel Endpoint发送消息。
@EndpointInjecct (uri ..) ProducerTemplate ...
是说
嘿我;是一个端点,这是我的uri和模板打我,所以打我
或者,嗯......在清澈湛蓝的天空下,某个地方有一个这个uri的终点,这就是我认为我会用
???
同样,是@Produce和ProducerTemplate
同样,@ Consume,
BTW,@ Produce(uri)或EndpointInjection(uri)中的uri
答案 0 :(得分:0)
As per your doubts, below I'm trying to clarify:
@EndpointInject (uri=...) ProducerTemplate ...
This means rather your 2nd option:
there is an endpoint with this uri somewhere out there beneath the clear blue skies, and here is the template I presume I'm gonna hit it with
I.e., uses the Camel API, ProducerTemplate, to send the message to another endpoint, defined on the uri.
Regarding the @Produce and ProducerTemplate, the closest guess here would be
specifying the template of a producer I am going to hit
Although technically the endpoint specified to be hit on the uri is not to be mistaken with the producer in Camel terminology, it is simply an endpoint, which in this context would be called a consumer since it receives messages.
Analogously, regarding @Consume marks the method as a consumer method, i.e. the one that handles the endpoint incomming messages, endpoint specified by the uri.
Hope this is of some help.