Search code examples
jbossjbossfuse

Who is using JBoss Fuse? What could you share about this product experience?


I am currently working on a company that is considering considering using JBoss Fuse 6.3. At the moment we are working with proof of concepts and some facts are happening: when we use the fully Open Source technologies (Camel or CXF) integrated to jetty / tomcat we can run without problems.

By integrating this into the JBoss Fuse platform we are experiencing serious packaging and deployment difficulties. I wonder if anyone is using this product until in production and what were the experiences / difficulties faced in this journey?


Solution

  • I actually work with many OSGi containers, and Karaf/JBoss Fuse never gave me any deployment issue.

    However, when you deploy into such containers your bundles must conform to OSGI specs regarding package imports and exports. Some tuning may be required for .wars.

    Some tips:

    1. Use an up-to-date version of maven-bundle-plugin (3.x)
    2. Use the official JBoss Fuse BOM when compiling your bundles
    3. Don't embed jars inside your bundles unless you have no other options
    4. Use wrap command to turn non-OSGi jars into OSGi compatible, works most of the times
    5. When you work with databases and ORMs, use javax.sql.DataSource and JPA, will save you a lot of classloading issues
    6. jdbc and jndi are your friends
    7. Publish your interfaces as OSGi services
    8. Use Blueprint as component model (works basically like Spring)
    9. Inject a service/bean from other bundles as an OSGi service
    10. Read "OSGi in Action" book
    11. Log to your own files instead of fuse.log (configure Log4j to do this inside etc/org.ops4j.pax.logging.cfg file)
    12. When you develop use 0.0.0-SNAPSHOT. It's fundamental. If you redeploy a bundle with the same version the OSGi runtime will probably reuse the previously loaded classes/resources and will not work as expected. You will not see new methods, updated code, and so on... With -SNAPSHOT version you force OSGi runtime to really reload the code.
    13. Launch with ./fuse debug so you can connect with your IDE and debug the code live. You can even debug into Camel / Blueprint / CXF / Felix / whatever library you want.

    Difficulties

    Learning curve is quite steep, as there are a lot of frameworks and technologies involved. A lot of examples and documentations you find online (even here on SO) are outdated.