[[eventMessage-eip]]
= Event Message

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

image::eip/EventMessageSolution.gif[image]

The default behaviour of many xref:ROOT:index.adoc[Components] is InOnly
such as for xref:ROOT:jms-component.adoc[JMS], xref:ROOT:jms-component.adoc[File] or
xref:ROOT:seda-component.adoc[SEDA]

TIP: See the related xref:requestReply-eip.adoc[Request Reply] message.

[[eventMessage-ExplicitlyspecifyingInOnly]]
== Explicitly specifying InOnly

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

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


== Samples

From 2.0 onwards on Camel you can specify the
xref:manual:ROOT:exchange-pattern.adoc[Exchange Pattern] using the DSL.

[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");
----

And with XML:

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

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

