Creating and Deploying OSGi bundle on Fuse ESB with Baby Steps
In this post, we’ll develop a Hello World OSGi Bundle. We will use Felix as OSGi container. I develop this without interacting with Maven.
To create OSGI Bundle we required Eclipse IDE, I used Eclipse 3.7.1
- Select File|New|Plug-in Project
Target Platform we will select “an OSGi framework” with standard option
- Click Next>. Your screen will be like below
- Click Next>.
You will find templates screen, Select
Hello OSGi Bundle
- Click Next>. And
here you will fine screen of OSGi Bundle Wizard, on this screen you can
set messages which will be display on start and stop of Bundle
- Click Finish>. Now we can see an Activator Class in Eclipse Project with start and stop methods, You can change source code as per your requirements.
export this project as OSGi Bundle jar do following
Select "File", "Export ...", "Plug-in Development", and select "Deployable Plug-ins and fragments":
- Click Next>. We
will point to the directory and Eclipse will create Jar and place it.
- Click Finish>.
Fuse ESB by running fuse.bat
- Now to deploy it on Fuse we will just
paste this jar file in deploy folder
soon as we paste file it will automatically get install, you will see
Hello World on console
can check installed OSGi Bundles with osgi:list, it will give bundle id
can start and stop bundle for like below