[[message-eip]]
== Message

Camel supports the
http://www.enterpriseintegrationpatterns.com/Message.html[Message] from
the link:enterprise-integration-patterns.html[EIP patterns] using the
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Message.html[Message]
interface.

image:http://www.enterpriseintegrationpatterns.com/img/MessageSolution.gif[image]

To support various message link:exchange-pattern.html[exchange patterns]
like one way link:event-message.html[Event Message] and
link:request-reply.html[Request Reply] messages Camel uses an
link:exchange.html[Exchange] interface which has a *pattern* property
which can be set to *InOnly* for an link:event-message.html[Event
Message] which has a single inbound Message, or *InOut* for a
link:request-reply.html[Request Reply] where there is an inbound and
outbound message.

Here is a basic example of sending a Message to a route in *InOnly* and
*InOut* modes using a `ProducerTemplate`

[source,java]
----
//InOnly
getContext().createProducerTemplate().sendBody("direct:startInOnly", "Hello World");

//InOut
Object result = getContext().createProducerTemplate().requestBody("direct:startInOut", "Hello World");
----

And an example with routes:

[source,java]
----
from("direct:startInOnly")
  .inOnly("bean:process");

from("direct:startInOut")
  .inOut("bean:process");
----

See link:https://github.com/apache/camel/blob/master/camel-core/src/main/docs/eips/to-eip.adoc[to-eip with pattern]
