title: Camel Routes and Endpoints
body: <p>I've been poring over the Apache Camel docs trying to get a concrete understanding of two of its most <em>basic</em> concepts (endpoints and routes), and although these terms are used everywhere throughout the docs, I can find no reference that actually defines what they are and what they are used for. And although their names are fairly obvious-sounding, and I <em>think</em> I understand what they are, I've now been assigned to a task that has landed me neck-deep in Apache Camel Land, and its absolutely vital that I understand what these mechanisms are.</p>
  
  <p>My guess is that an "endpoint" is just a bean - one that can be configured in a config file like any other - that maps a name to a URI/port combo (this taken from the W3C docs). In the context of Apache Camel, my <em>guess</em> is that endpoints are used to connect components together, so that "routes" (connections/maps) can be formed between them. So when Component A living at Endpoint 1 wants to communicate with Component B living at Endpoint 2, so long as there is a mapping from 1 to 2, Camel will be able to transmit messages between these two.</p>
  
  <p><strong>Please stop me and correct me if I am wrong here!</strong></p>
  
  <p>So now, I've seen examples where it looks like routes can be configured in Java:</p>
  
  <pre><code>from("endpointA").routeId("someMessage").to("endpointB");
  </code></pre>
  
  <p>And I've seen examples where it looks like routes can be configured in XML:</p>
  
  <pre><code>&lt;route id=""&gt;
      &lt;from .../&gt;
      &lt;to .../&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>Are these two methods for configuring routes, or are they different concepts altogether?</p>
  
  <p>Finally, <em>what is the format of the messages that can be routed between endpoints?</em> If it has to be XML, for example, what is the XSD/schema of these routed messages? If it has to be a Java object, what bounds/restrictions apply to the objects that Camel can send?</p>