Camel-CXF Web Service Blueprint Bundle Deployment in Red Hat Fuse 7.1.0

Camel-CXF Web Service Blueprint Bundle Deployment in Red Hat Fuse 7.1.0
A quick reference to deploy a Camel CXF Web Service Project in Red Hat Fuse 7.1.0.

Technologies and Tools used in this quick reference guide are

1. GitHub
2. Maven 3.3.9
3. Red Hat Fuse 7.1.0
4. Java JDK version 1.8.0_151 64 bit.
5. Apache Camel 2.21.1
6. Apache CXF (as camel-cxf component).
7. EhCache (as camel-ehcache component).
8. Apache Felix (OSGI bundle plugin in pom.xml)


GIT CLONE:


Navigate through the below URL https://github.com/bharaniravikanth/Bharani_Technical_Repo_Parent which will redirect to my public Repository.



Now Click on Clone or Download button and copy the git url 




now clone it into your local PC either through GitHub command line or GitHub Desktop.



After cloning directory structure will be as below




Maven Build:


Open Command Prompt and go through the  git cloned directory and execute the command

mvn clean install

And the final output after execution of the above command is as below.

[INFO] bharani-technical-blog-master ...................... SUCCESS [  0.578 s]
[INFO] btb-apache-camel-cxf ............................... SUCCESS [ 12.808 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS


Start Red Hat Fuse 7.1.0:

Go through the FUSE_HOME/bin directory through command prompt and execute the fuse.bat file. Execution of fuse.bat batch file will start the fuse container.




Deployment:

Note:
Since we are using camel-ehcache component please install the camel-ehcache feature in Red hat fuse 7.1.0,  by default camel-ehcache feature is in uninstalled state.




We can check the state of any feature by executing the command in fuse console as below

feature:list | grep <feature name > 

To install the feature please execute the below command in fuse console as below 

feature:install camel-ehcache



execute the command as below in fuse console to see list of features are started and active state.

osgi:list (or) list







1. Hot Deployment


Take the bundle (.jar file) from the target directory


Place the bundle inside Fuse_Home/deploy directory



Fuse Bundle watcher will listen to the deploy directory once the bundle is placed fuse bundle watcher will deploy the bundle in the red hat fuse container. 



2. Maven Bundle reference 

We can install the bundle with mvn reference, execute the following command in fuse console

osgi:install -s mvn:org.bharani.blog/btb-apache-camel-cxf/0.0.1-SNAPSHOT



Below is the nomenclature for installing any bundle with auto start option in red hat fuse

osgi:install -s mvn:<groupId>/<artifactId>/<version>



Accessing the Web Service:

After deployment of the bundle in the red hat fuse container, open the browser navigate through the url 
http://127.0.0.1:8181/cxf 
 (or) 

http://localhost:8181/cxf


We can see the list of web services exposed in the red hat fuse



Now click on the WSDL http link to get the wsdl (text/html) format.