= Direct Component
:doctitle: Direct
:shortname: direct
:artifactid: camel-direct
:description: Call another endpoint from the same Camel Context synchronously.
:since: 1.0
:supportlevel: Stable
:component-header: Both producer and consumer are supported
:core:
//Manually maintained attributes
:camel-spring-boot-name: direct

*Since Camel {since}*

*{component-header}*

The Direct component provides direct, synchronous invocation of any
consumers when a producer sends a message exchange. +
 This endpoint can be used to connect existing routes in the *same*
camel context.

[TIP]
====
*Asynchronous*

The xref:seda-component.adoc[SEDA] component provides asynchronous invocation of
any consumers when a producer sends a message exchange.
====

[TIP]
====
*Connection to other camel contexts*

The xref:vm-component.adoc[VM] component provides connections between Camel
contexts as long they run in the same *JVM*.
====

== URI format

[source]
----
direct:someName[?options]
----

Where *someName* can be any string to uniquely identify the endpoint


// component-configure options: START

// component-configure options: END

// component options: START
include::partial$component-configure-options.adoc[]
include::partial$component-endpoint-options.adoc[]
// component options: END

// endpoint options: START

// endpoint options: END


== Samples

In the route below we use the direct component to link the two routes
together:

[source,java]
----
from("activemq:queue:order.in")
    .to("bean:orderServer?method=validate")
    .to("direct:processOrder");

from("direct:processOrder")
    .to("bean:orderService?method=process")
    .to("activemq:queue:order.out");
----

And the sample using spring DSL:

[source,xml]
----
<route>
 <from uri="activemq:queue:order.in"/>
 <to uri="bean:orderService?method=validate"/>
 <to uri="direct:processOrder"/>
</route>

<route>
 <from uri="direct:processOrder"/>
 <to uri="bean:orderService?method=process"/>
 <to uri="activemq:queue:order.out"/>
</route>
----

See also samples from the xref:seda-component.adoc[SEDA] component, how they can
be used together.



include::spring-boot:partial$starter.adoc[]
