此内容没有您所选择的语言版本。

Chapter 3. Features


This chapter provides the necessary information about Camel on EAP features.

Camel Context Definitions

To configure camel contexts as a part of the subsystem definition, perform the following in the standalone.xml file:

<subsystem xmlns="urn:jboss:domain:camel:1.0">
   <camelContext id="system-context-1">
     <![CDATA[
     <route>
       <from uri="direct:start"/>
       <transform>
         <simple>Hello #{body}</simple>
       </transform>
     </route>
     ]]>
   </camelContext>
</subsystem>

Camel Context Deployments

You can deploy camel contexts to JBoss EAP with a -camel-context.xml suffix as:

  • a standalone XML file
  • a part of another supported deployment

A deployment may contain multiple -camel-context.xml files.

A deployed Camel context is CDI injectable like this

@Resource(name = "java:jboss/camel/context/mycontext")
CamelContext camelContext;
[discrete]
### Management Console

By default, access to management consoles is secured. Therefore, you need to setup a Management User first.

$ bin/add-user.sh

What type of user do you wish to add?
 a) Management User (mgmt-users.properties)
 b) Application User (application-users.properties)

The Hawt.io console should show the camel context from subsystem configuration.

hawtio camel 01

Arquillian Test Support

The Camel on EAP test suite uses the WildFly Arquillian managed container. This can connect to an already running JBoss EAP instance or alternatively start up a standalone server instance when needed.

A number of test enrichers have been implemented that allow you to have these Camel on EAP specific types injected into your Arquillian test cases.

@ArquillianResource
CamelContextFactory contextFactory;

@ArquillianResource
CamelContextRegistry contextRegistry;
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.