How to use Camel without Switchyard in Fuse on EAP
Environment
- Red Hat JBoss Fuse
- 6.2.1
- Red Hat JBoss Enterprise Application Pltatform (EAP)
- 6.4.x
Issue
-
We are currently trying to create an application that contains only camel routes and deploy these to FSW (or just FUSE 6.2.1) on EAP 6.4.5.
Our question is; is there any way to do this only with jar files the same way we can deploy switchyard "jar's" or we need some other method like WAR files to deploy camel routes into FUSE? -
We have read a lot of documentation, and seen many examples or quickstarts, but none of these solve my questions. I have read these mainly:
-
How can we deploy and only use camel in FUSE 6.2.1 on EAP without using Switchyard ?
Resolution
-
If the project you have developed is not a switchyard project, then you can deploy a simple camel route either using Java DSL or spring DSL.
For example, you can create a route in a spring xml file and name the file as 'name-camel-context.xml'. Here's suffix, -camel-context.xml is a must, without that the spring file will not be bootstrapped and the camelContext will not be instantiated. -
You can create a 'jar' file and you can simply have
META-INF/spring/hi-camel-context.xml. (you can give any name, i have given 'hi').
Then you can directly deploy the file inside /deploy folder. In this case, you are not using switchyard, but a plain camel route.
Similarly, in case of using Java DSL, you can refer to our quickstarts, quickstarts/camel. -
Switchyard application have
META-INF/switchyard.xmlfile. There are differences in switchyard applications and pure camel applications. You can see from the /quickstarts/switchyard.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
