[[EventMessage-EventMessage]]
Event Message
~~~~~~~~~~~~~

Camel supports the
http://www.enterpriseintegrationpatterns.com/EventMessage.html[Event
Message] from the link:enterprise-integration-patterns.html[EIP
patterns] by supporting the link:exchange-pattern.html[Exchange Pattern]
on a link:message.html[Message] which can be set to *InOnly* to indicate
a oneway event message. Camel link:components.html[Components] then
implement this pattern using the underlying transport or protocols.

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

The default behaviour of many link:components.html[Components] is InOnly
such as for link:jms.html[JMS], link:file2.html[File] or
link:seda.html[SEDA]

[TIP]
====
*Related*

See the related link:request-reply.html[Request Reply] message.
====

[[EventMessage-ExplicitlyspecifyingInOnly]]
Explicitly specifying InOnly
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you are using a component which defaults to InOut you can override
the link:exchange-pattern.html[Exchange Pattern] for an endpoint using
the pattern property.

[source,java]
------------------------------
foo:bar?exchangePattern=InOnly
------------------------------

From 2.0 onwards on Camel you can specify the
link:exchange-pattern.html[Exchange Pattern] using the DSL.

*Using the link:fluent-builders.html[Fluent Builders]*

[source,java]
---------------------------------------------
from("mq:someQueue").
  setExchangePattern(ExchangePattern.InOnly).
  bean(Foo.class);
---------------------------------------------

or you can invoke an endpoint with an explicit pattern

[source,java]
----------------------------
from("mq:someQueue").
  inOnly("mq:anotherQueue");
----------------------------

*Using the link:spring-xml-extensions.html[Spring XML Extensions]*

[source,java]
------------------------------
<route>
    <from uri="mq:someQueue"/>
    <inOnly uri="bean:foo"/>
</route>
------------------------------

[source,java]
-----------------------------------
<route>
    <from uri="mq:someQueue"/>
    <inOnly uri="mq:anotherQueue"/>
</route>
-----------------------------------

[[EventMessage-UsingThisPattern]]
Using This Pattern
++++++++++++++++++

If you would like to use this EIP Pattern then please read the
link:getting-started.html[Getting Started], you may also find the
link:architecture.html[Architecture] useful particularly the description
of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could
try out some of the link:examples.html[Examples] first before trying
this pattern out.
