7 Replies Latest reply on Jun 30, 2009 8:16 AM by Stan Lewis

    Starting fuse: maven osgi bundle deploy

    vector_jdev.work Newbie

      We've decided to move our system under FUSE and just trying to start using it. Can anybody help me with answering some simple questions:  I need sample application using maven + fuse + osgi which will be able to listen some http protocol input. The questions are:

      1. How to set up maven pom.xml to develop&deploy osgi bundles to fuse container? What kind of dependencies I need to include, what respositories to use and what kind of plugin to deploy to fuse from my IDE?

      2. How to configure my app to listen to incoming http requests on some host&port? Are there any build in solutions for that?

       

      3. FUSE uses jetty, so after installation it grab localhost:8080 address so I am unable to use my tomcat which is also locally installed. Are there any ways to swith jetty off?

       

      Thanks.

        • 1. Re: Starting fuse: maven osgi bundle deploy
          Stan Lewis Novice

          There's a number of samples that show a few different approaches that you can work from depending on what you're doing.  If you want to do your integration using JBI you may want to check out the "bridge" sample which shows how to build/deploy a JBI service assembly, and basically builds an http to JMS bridge with a transform in between.  You can also see the same flow implemented in Camel in the bridge-camel sample, which is a good alternative to JBI if you don't like the JBI packaging and you want more flexibility.

           

          You may also want to check out the FUSE Integration Designer which helps you graphically build Camel routes to solve integration problems.

           

          I didn't see anything listening on 8080 via netstat after doing a fresh FUSE ESB 4.1 install, though the cxf-osgi example does use port 8080, you should be able to change this by modifying examples/cxf-osgi/src/main/resources/META-INF/spring/beans.xml and changing the address like:

           

              address="http://localhost:8090/HelloWorld"

           

          then rebuild the demo and redeploy it.  Hope that helps!

          • 2. Re: Starting fuse: maven osgi bundle deploy
            vector_jdev.work Newbie

            Hello, thanks for you reply!

            As I understand now there are 2 ways to write modules for FuseESB - one is use JBI Service Assembly, and another is to use OSGi bundle(correct me if Iam wrong). What we need is to develop application that uses pluggable modules, so that if new modules will be added, the QA team should be able to test only that new module(functionality) without re-testing the whole application. We will have more applications added that will use each other, and the "test only new functionality" idea must remain.

            Also as I see also the OSGi allows more flexibility comparing with JBI, correct me if I am wrong.For example you can have 2 versions of bundle running in the system so when trying new buisiness logic in production you can still remain old module handle old functionality without any risk. That is why we need OSGi.

             

            I really don't understand what do you mean by saing "you can use camel if you want more flexibility". As I see camel is just about routing between "modules" which can be JBI or OSGI within ESB, isn't it? Can you explain what you mean?

             

            Thanks, Alex.

            • 3. Re: Starting fuse: maven osgi bundle deploy
              Stan Lewis Novice

              Really camel can do more than route between modules, by flexability I mean in the types of endpoints and data formats you can handle in Camel, and you're not just limited to XML as a payload format either.  In any case I was just trying to give you a rundown on some of your options and what examples exist, what you're going to ultimately need to use is pretty dependent on what kind of integration problem you're trying to solve.

              • 4. Re: Starting fuse: maven osgi bundle deploy
                vector_jdev.work Newbie

                Hello!

                For now, I am just trying to understand how to add buisiness logic without retesting&redeploying all application based on Fuse. In other words the way of system functionality will be added is limited to 2 things in FUSE: using OSGI bundles or JBI assemblies(as I think). Can you tell me if my assumption is true?

                 

                As for JBI - I found some samples of how to deploy that to fuse using IDE+Maven2 plugin.

                As for OSGi - I still don't have any ideas(samples) how to create&deploy bundle using maven. Can you help me with some hints?

                 

                Thanks.

                • 5. Re: Starting fuse: maven osgi bundle deploy
                  Stan Lewis Novice

                  Gotcha!  So yes, you're right, you can use either JBI packaging or OSGi bundles.

                   

                  Have you seen Ade's screencast on deploying a POJO into servicemix 4?  The direct link is here and it's on this page in the "Demo Videos" tab, second item.  There's a lot of information in these videos, hopefully that'll get you going in the right direction...

                  • 6. Re: Starting fuse: maven osgi bundle deploy
                    vector_jdev.work Newbie

                    One little question more from me is how JBI assemblies and OSGi bundles are build to work together. Another words can I just create one module that will listen to incoming http request and router=JBI sa, and 2 other modules that will get requests from and handle them as 2 OSGi bundles????

                     

                    Edited by: vector on Jun 29, 2009 3:44 PM

                     

                    Edited by: vector on Jun 29, 2009 3:45 PM

                    • 7. Re: Starting fuse: maven osgi bundle deploy
                      Stan Lewis Novice

                      Yep, you can do a JNDI lookup from a JBI SU and then call onto your OSGi service - http://servicemix.apache.org/nmr/7-jndi-integration.html