You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by raulvk <ra...@atosorigin.com> on 2008/03/27 17:24:28 UTC

Difference between 'service' and 'endpoint'

Dearest ServiceMix experts,

I have been trying to grasp the concepts of the 'service' and 'endpoint' XML
attributes when defining a service in an xbean.xml file, but the more I read
the less I understand.

For example, in the servicemix-http section of the ServiceMix website, there
is the following example:

<http:endpoint service="test:MyConsumerService"
               endpoint="myConsumer"
               role="consumer" 
               locationURI="http://localhost:8192/Service/"
               defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />

When some other service unit wishes to invoke this service, can they either
use the service name or the endpoint name? If yes, what is the difference
between invoking an endpoint and invoking a service?

When invoking a service unit from Camel, when would you use jbi:endpoint and
jbi:service?

Thank you very much!

Raul.


-- 
View this message in context: http://www.nabble.com/Difference-between-%27service%27-and-%27endpoint%27-tp16327201s12049p16327201.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Difference between 'service' and 'endpoint'

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Mar 27, 2008 at 10:24 AM, raulvk <ra...@atosorigin.com> wrote:
>
>  Dearest ServiceMix experts,
>
>  I have been trying to grasp the concepts of the 'service' and 'endpoint' XML
>  attributes when defining a service in an xbean.xml file, but the more I read
>  the less I understand.
>
>  For example, in the servicemix-http section of the ServiceMix website, there
>  is the following example:
>
>  <http:endpoint service="test:MyConsumerService"
>                endpoint="myConsumer"
>                role="consumer"
>                locationURI="http://localhost:8192/Service/"
>                defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
>
>  When some other service unit wishes to invoke this service, can they either
>  use the service name or the endpoint name? If yes, what is the difference
>  between invoking an endpoint and invoking a service?

A service is the object that is doing the real work with the message.
The endpoint is how a service is exposed. Let me draw an analogy to
try to clarify. A web application is similar to a service; it's the
thing that does the real work. The URI that is used to expose the web
app is similar to the endpoint; it's simply the manner in which the
web app is exposed. And the same web app can be exposed on multiple
URIs for different reasons, e.g., maybe you have different customers
hit the same web app using different URIs so that you can track the
hits unique to each customer. The same is true for a JBI endpoint. The
same service can be exposed via multiple different endpoint names.

>From the JBI spec, when a consumer initiates a MessageExchange, it has
a choice of how to address the exchange to indicate the target
service. In order of increasing granularity, the three choices are:

* the service type - the consumer provides the interface name to
indicate the type of service but not a specific endpoint; the NMR will
choose an appropriate endpoint
* the service name - the consumer provides the service name but not
the specific endpoint; the NMR will choose an appropriate endpoint
* the service endpoint - the consumer provides the exact endpoint
name; the NMR simply routes to that endpoint name

The NMR will always use the most specific address provided.

ServiceMix allows you to route using an interface name, a service name
or the combination of the service name and endpoint name.

>  When invoking a service unit from Camel, when would you use jbi:endpoint and
>  jbi:service?

Camel offers the ability to route based on either service name or
endpoint name. E.g., if you only have one copy of service X deployed,
then you can route using the jbi:service. If you have three copies of
service X deployed using three unique endpoint names, then you'd use
the jbi:endpoint.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/