1 2 3 Previous Next 33 Replies Latest reply on Feb 3, 2011 1:42 PM by jumanji4u Go to original post
      • 15. Re: Camel integration input requested
        dward

        Fantastic idea Tom!  This would be a great baby step for 4.x.  I'll go ahead and leave the JBESB_4_8_Camel workspace alone, and create a new workspace that flushes out your idea.  Luckily, most of the work I already did can be re-used with this idea, so I can do a lot of copy/paste. 

        • 16. Re: Camel integration input requested
          dward
               <camel-listener ... /> 
          

           

          Hmmm...  <camel-listener/>, or <camel-gateway/>?  Decisions, decisions... 

          • 17. Re: Camel integration input requested
            tfennelly

            Oh yeah... sorry... would be gateway I suppose

            • 18. Re: Camel integration input requested
              dward

              I'm thinking that it would still be nice to have a <providers> section too, so that we can have multiple routes in one CamelContext.  Since, if you do this:

               

              <listeners>
                  <camel-gateway from="file://xxx" />
                  <camel-gateway from="ftp://yyy" />
              </listeners>
              

               

              , we would have to create 2 different CamelContexts, one for each gateway.  However, if we do this:

               

              <providers>
                  <camel-provider name="...">
                      <camel-bus busid="foo">
                          <from uri="file://xxx" />
                          <from uri="ftp://yyy" />
                      </camel-bus>
                  </camel-provider>
              </providers>
              <services>
                  <listeners>
                      <camel-gateway name="..." busidref="foo" />
                  </listeners>
                  <actions>...</actions>
              </services>
              

               

              , then we can have multiple Camel routes as part of a single CamelContext - one per bus.  I also like using the <from> tag in the <camel-bus> section, as it is familiar to current Camel users.  The only caveat - for 4.x, anyway - is that ONLY the <from> tag would be supported by us.

               

              What do you think?  Should we also allow the <camel-gateway from="" /> shorthand?  I wonder if we can define in XSD that you use either the busidref attribute, OR the from attribute?  Or maybe we let them do both, and all "from's" get put into the same CamelContext?  I think I prefer that...

              • 19. Re: Camel integration input requested
                dward

                Okay, a bit more discussion on the team, and this is looking like the new direction.  You would have several options, including some shorthand:

                 

                <listeners>
                    <camel-gateway name="..." from="foo://bar" />
                </listeners>
                

                 

                <listeners>
                     <camel-gateway name="...">
                        <from uri="foo://bar" />
                        <from uri="foo://bar" />
                    </camel-gateway>
                </listeners>
                

                 

                <listeners>
                     <camel-gateway name="..." from="foo://bar">
                        <from uri="foo://bar" />
                        <from uri="foo://bar" />
                    </camel-gateway>
                </listeners>
                

                 

                <providers>
                    <camel-provider name="...">
                        <camel-bus busid="xxx" from="foo://bar">
                    </camel-provider>
                </providers>
                <services>
                    <service category="..." name="...">
                        <listeners>
                            <camel-gateway name="..." busidref="xxx" />
                        </listeners>
                        <actions>...</actions>
                    </service>
                </services>

                 

                <providers>
                     <camel-provider name="...">
                         <camel-bus busid="xxx">
                            <from uri="foo://bar" />
                            <from uri="foo://bar" />
                        </camel-bus>
                    </camel-provider>
                </providers>
                <services>
                    <service category="..." name="...">
                        <listeners>
                            <camel-gateway name="..." busidref="xxx" />
                        </listeners>
                        <actions>...</actions>
                    </service>
                </services>
                

                 

                You get the idea.    Basically, all "from's" associated with a gateway would be combined into a single CamelContext.  If you specify multiple camel-gateways in the listeners section that refer to the same bus, then the routes defined in the <camel-bus> section are created separately in each CamelContext - again, one per gateway.

                • 20. Re: Camel integration input requested
                  dward

                  I've improved upon the XML suggestion above, and now support native Camel <route>s, with NO dependency on Spring.  All of this is explained in the new wiki page ("CamelGateway"), located here:

                   

                  http://community.jboss.org/wiki/CamelGateway

                   

                  (The old wiki page and workspace have been delted in favor of the above.)

                  • 21. Re: Camel integration input requested
                    kconner

                    The suggestion above is as far as we will take it for 4.x, anything else won't go in at this stage.

                     

                    Kev

                    • 22. Re: Camel integration input requested
                      dward

                      Understood.

                       

                      I do have a question, though...  So the <from>s under <camel-gateway> are additive to the <from>s under <camel-bus>, but what if the user chooses the from-uri attribute in both the gateway and the bus?  Should those be additive as well, or should the gateway's from-uri attribute override/trounce the bus'?

                      • 23. Re: Camel integration input requested
                        dward

                        A jira feature request has been added: https://jira.jboss.org/browse/JBESB-3329

                        • 24. Re: Camel integration input requested
                          dward

                          After giving it some thought, I think that attributes defined at the <camel-gateway> level should override those at the <camel-bus> level (so that the from-uri attribute behaves just like the async and timeout attributes), however <from> elements defined inside camel-gateway are added to those at the <camel-bus> level.

                          • 25. Re: Camel integration input requested
                            dward

                            Scaling back to only supporting Camel "from" URIs has been done in this workspace:

                                 http://anonsvn.jboss.org/repos/labs/labs/jbossesb/workspace/dward/JBESB_4_8_Camel_Gateway

                            , and the wiki page has been updated to match:

                                 http://community.jboss.org/wiki/CamelGateway

                            There are a couple things I need to clean up before I merge it into trunk for ESB 4.9.

                            • 26. Re: Camel integration input requested
                              kconner

                              We have had this discussion in a couple of locations now, but here is definitely the right place for it.

                              I think that attributes defined at the <camel-gateway> level should override

                              No, they still should not override.  If the intention is to replace the bus then they must specify a new bus or do without.

                               

                              If the bus is referenced then it adds to the bus.

                               

                              Kev

                              • 27. Re: Camel integration input requested
                                dward

                                The code and wiki have been updated to reflect the cummulative nature of from-uri attributes so they are added just like <from uri=""> elements.

                                • 28. Re: Camel integration input requested
                                  dward

                                  The CamelGateway has been committed to trunk in revision 33127.  Woot!

                                  • 29. Re: Camel integration input requested
                                    kcbabo

                                    Nice follow-up article on integrating components outside of Camel Core:

                                     

                                    http://community.jboss.org/wiki/CamelGatewayUsingnon-coreComponents

                                     

                                    o Is the jboss.esb lib directory the only recommended place to put component libraries?  It's certainly possible to put it in one of the higher level AS lib directories.  Is it possible to bundle them with the ESB application?  Do we recommend against these other methods?

                                     

                                    o Component jars in the jboss.esb lib directory will be loaded during server startup.  Correct me if I'm wrong, but adding additional jars here will require the ESB sar to be redeployed or (more likely) the server restarted.  Might want to point this out.

                                     

                                    o Having a single class loading space for additional components means that there can only be one version of a component in the ESB runtime at any given time.  Probably worth mentioning this point.

                                     

                                    o There is a distinct possibility that one of the many camel components will include jars that we already have in the ESB or the AS already.  If the versions of these dependencies are different than things can go boom.  Isolating the class space with class loader repository might be one way to address this.  Another way to address it is to say "YMMV". ;-)

                                     

                                    `k.