| [[HowdoesCamellookupbeansandendpoints-HowdoesCamellookupbeans,componentsorendpoints]] |
| = How does Camel look up beans, components or endpoints? |
| |
| There are many times using Camel that a name is used for a bean such as |
| using the xref:components::bean-component.adoc[Bean] endpoint or using the |
| xref:components:languages:bean-language.adoc[Bean Language] to create a |
| xref:ROOT:expression.adoc[Expression] or xref:ROOT:predicate.adoc[Predicate] or |
| referring to any xref:ROOT:component.adoc[Component] or |
| xref:ROOT:endpoint.adoc[Endpoint]. |
| |
| Camel uses the xref:ROOT:registry.adoc[Registry] to resolve names when |
| looking up beans or components or endpoints. Typically this will be |
| xref:ROOT:spring.adoc[Spring]; though you can use Camel without Spring in |
| which case it will use the xref:ROOT:jndi.adoc[JNDI] registry implementation. |
| |
| Lots of test cases in the camel-core module don't use Spring (as |
| camel-core explicitly doesn't depend on spring) - though test cases in |
| camel-spring do. |
| |
| So you can just define beans, components or endpoints in your |
| xref:ROOT:registry.adoc[Registry] implementation then you can refer to them |
| by name in the xref:ROOT:endpoint.adoc[Endpoint] URIs or xref:components::bean-component.adoc[Bean] |
| endpoints or xref:components:languages:bean-language.adoc[Bean Language] expressions. |