Apache Camel 中用到的基本概念和术语

1. Endpoint
  Camel provides out-of-the-box support for endpoints implemented with many different communication technologies.
  Here are some examples of the Camel-supported endpoint technologies:
  1. A JMS queue.
  2. A web service.
  3. A file.
    A file may sound like an unlikely type of endpoint, until you realize that
    in some systems one application might write information to a file and, later, another application might read that file.
  4. An FTP server.
  5. An email address.
    A client can send a message to an email address, and a server can read an incoming message from a mail server.
  6. A POJO (plain old Java object).

2. CamelContext
  A CamelContext object represents the Camel runtime system.
  A typical application executes the following steps:
    1. Create a CamelContext object.
    2. Add endpoints ( and possibly Components) to the CamelContext object.
    3. Add routes to the CamelContext object to connect the endpoints.
    4. Invoke the start() operation on the CamelContext object.
      This starts Camel-internal threads that are used to process the sending, receiving and processing of messages in the endpoints.
    5. Eventually invoke the stop() operation on the CamelContext object.
      Doing this gracefully stops all the endpoints and Camel-internal threads.

3. CamelTemplate
  The CamelTemplate class is a thin wrapper around the CamelContext class.
  It has methods that send a Message or Exchange to an Endpoint.
  This provides a way to enter messages into source endpoints, so that the messages will move along routes to destination endpoints.

4. Meaning of URL, URI, URN and IRI
  URL: uniform resource locators, such as "http://...", "ftp://...", "mailto:...". Put simply, a URL specifies the location of a resource.
  URI: uniform resource identifier.
  IRI: internationalized resource identifier.
    An IRI is simply an internationalized version of a URI.
  URN: uniform resource name
    A URN is a wrapper for different "unique identifier" schemes.
    The syntax of a URN is "urn:<scheme-name>:<unique-identifier>".
    By itself, a URN does not specify the location of the resource.
    Instead, it is assumed that a registry provides a mapping from a resource's URN to its location.
    Some hypothetical examples of URNs are "urn:employee:08765245", "urn:customer:uk:3458:hul8" and "urn:foo:0000-0000-9E59-0000-5E-2".
    The <scheme-name> part of a URN implicitly defines how to parse and interpret the <unique-identifier> that follows it.
    To date, URNs are not (yet) as popular as URLs. For this reason, URI is widely misused as a synonym for URL.

5. Components
  (Component is confusing terminology here)
  Component here is nothing but a factory for creating Endpoint instances, so EndpointFactory would have been more appropriate.

5. Message and Exchange
  The Message interface provides an abstraction for a single message,
    such as a request, reply or exception message.
  The Exchange interface provides an abstraction for an exchange of messages,
    that is, a request message and its corresponding reply or exception message.

6. Processor
  The Processor interface represents a class that processes a message.

7. Routes
  A route is the step-by-step movement of a Message from an input queue,
  through arbitrary types of decision making (such as filters and routers) to a destination queue (if any). 

Reference from:
  http://camel.apache.org/book-getting-started.html
  

 

posted @ 2012-04-07 18:40  万法自然~  阅读(565)  评论(0)    收藏  举报