1 2 3 Previous Next 64 Replies Latest reply: Oct 2, 2009 2:43 PM by Kevin Conner RSS

XPath Routing

Tom Fennelly Master

Hi the following JIRA is a feature request for XPath based routing: https://jira.jboss.org/jira/browse/JBESB-2583

In terms of "general" requirements, what did people have in mind?

  • 1. Re: XPath Routing
    Tom Fennelly Master

    As I see it, there are 2 "main" options here:

    1. Route the complete message (aka "Filtering") based on the result of an XPath evaluation.

    2. Route a fragment of the message (or fragments, aka "splitting") based on an XPath expression.

    I think we definitely want #1. Perhaps people (Burr etc) also wanted #2 included as part of this. I think we should do #2 as a separate task.

  • 2. Re: XPath Routing
    Tom Fennelly Master

    So for filtering (option #1 above), we could use the SXC XPath frontend (http://sxc.codehaus.org/XPath).

  • 3. Re: XPath Routing
    Kevin Conner Master

    The current work does not concern routing of fragmented message, so ignore 2 for now. We are just extending the current ContentBasedRouter to include implementations other than drools.

    Kev

  • 4. Re: XPath Routing
    Tom Fennelly Master

    OK :)

    The ContentBasedRouter interface is in the rosetta codebase, as is the ContentBasedRouterFactory, which is fine.

    The ContentBasedRouter and ContentBasedWiretap actions are in the jbrules service. Seems to me like these should be in the rosetta codebase if they are supposed to allow a plugable ContentBasedRouter.

    The ContentBasedWiretap class uses the ContentBasedRouterFactory to create the actual ContentBasedRouter impl (defaulting to the JBossRulesRouter)... lovely. In reality, however, the ContentBasedWiretap is not at all generic, as it is littered with drools specific stuff. I'd be curious to see what would actually happen if you configured a different "cbrClass" on that action - one that doesn't use rule files etc :)

    Kev, what do you want to do about these issues (well... imo, they're issues if we want to use ContentBasedWiretap as a basis :) ) ? I think they can be sorted out with effecting BC, but perhaps you don't want to do that. Just let me know what you want.

  • 5. Re: XPath Routing
    Kevin Conner Master

     

    "tfennelly" wrote:
    The ContentBasedRouter and ContentBasedWiretap actions are in the jbrules service. Seems to me like these should be in the rosetta codebase if they are supposed to allow a plugable ContentBasedRouter.


    IIRC there should be no drools related code in these so this is another example of code being in the wrong place :)

    "tfennelly" wrote:
    The ContentBasedWiretap class uses the ContentBasedRouterFactory to create the actual ContentBasedRouter impl (defaulting to the JBossRulesRouter)... lovely. In reality, however, the ContentBasedWiretap is not at all generic, as it is littered with drools specific stuff. I'd be curious to see what would actually happen if you configured a different "cbrClass" on that action - one that doesn't use rule files etc :)


    littered?? Perhaps that is a slight exaggeration?

    I can't see anything there that forces you into drools, other than it is obviously biased that way in the comments and defaults to it. What exactly are you concerned with??

    "tfennelly" wrote:
    Kev, what do you want to do about these issues (well... imo, they're issues if we want to use ContentBasedWiretap as a basis :) ) ? I think they can be sorted out with effecting BC, but perhaps you don't want to do that. Just let me know what you want.

    Not sure what you mean by 'sorted out with effecting BC' but there doesn't seem to be anything of major concern in the way it is currently written. True, it is not a 'pure' interface in that it does not correctly abstract the functionality but then the same can be said about most of our current codebase.

    Apart from moving the classes into rosetta what is it that you see as a concrete, necessary within that codebase?

    Kev

  • 6. Re: XPath Routing
    Kevin Conner Master

     

    "Kevin.Conner@jboss.com" wrote:
    Apart from moving the classes into rosetta what is it that you see as a concrete, necessary within that codebase?

    This should read 'concrete, necessary change within'

    Kev

  • 7. Re: XPath Routing
    Tom Fennelly Master

     

    "Kevin.Conner@jboss.com" wrote:
    "Kevin.Conner@jboss.com" wrote:
    Apart from moving the classes into rosetta what is it that you see as a concrete, necessary within that codebase?

    This should read 'concrete, necessary change within'

    Kev


    Nothing else.... that will be fine.

  • 8. Re: XPath Routing
    Tom Fennelly Master

    Just to be clear Kev... you want the XPath "rules" to be in an external rules file Vs being inline in the ESB config?

  • 9. Re: XPath Routing
    Tom Fennelly Master

     

    "tfennelly" wrote:
    Just to be clear Kev... you want the XPath "rules" to be in an external rules file Vs being inline in the ESB config?


    Of course... both options would be nice from a users pov.

  • 10. Re: XPath Routing
    Burr Sutter Master

    My original vision of this feature was to have the XPath expression (and/or Regex expression) "inline" - embedded in the jboss-esb.xml.

    The inline approach makes it much, much easier from a learning curve standpoint. It does require a reload/redeploy of the jboss-esb.xml and its .esb archive to make a change happen. I think inline is a must-have for learning curve standpoint.

    The value of the external file approach, like in the Drools-based CBR, is that I can change the file without causing a redeploy of the .esb archive, no touch to jboss-esb.xml.

    So I like both options. :-)

  • 11. Re: XPath Routing
    Tom Fennelly Master

    From a users POV, I also don't like the idea of having to specify 2 classes i.e. the ContentBasedRouter action and the the cbrClass property to specify the ContentBasedRouter implementation (so... "....XPathRouter" and "....RegexRouter"). That sucks imo :)

  • 12. Re: XPath Routing
    Kevin Conner Master

     

    "tfennelly" wrote:
    From a users POV, I also don't like the idea of having to specify 2 classes i.e. the ContentBasedRouter action and the the cbrClass property to specify the ContentBasedRouter implementation (so... "....XPathRouter" and "....RegexRouter"). That sucks imo :)


    Totally agree, which is why you shouldn't do that. The cbrClass is there to provide the users with a way of overriding what we do, not configuring what we do.

    At the moment that class has a default value for drools but only because that is the only one we support at present. Add an attribute to override this, make it simple. Why do yet another C&P job when it is not necessary?

    Kev

  • 13. Re: XPath Routing
    Kevin Conner Master

     

    "burrsutter" wrote:
    So I like both options. :-)

    There is no reason why both can't be used as the configuration is already being passed through to the CBR implementation. Each can easily have configuration specific to their own implementation.

    Kev


  • 14. Re: XPath Routing
    Tom Fennelly Master

     

    "Kevin.Conner@jboss.com" wrote:
    Why do yet another C&P job when it is not necessary?


    I don't think anyone was suggesting doing a C&P job.

    So you want an attribute containing an alias of some sort on it Vs specifying the actual class?

1 2 3 Previous Next