Announcement Announcement Module
Collapse
No announcement yet.
header-value-router Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • header-value-router

    It seems that the header-value-router only supports headers of type String.
    I have a jms header, specifically springintegration_jms_redelivered which is a Boolean, that I would like to route on.

    I can write my own router bean easily enough but I was wondering if there were any plans to modify the header-value-router which I think ends up at HeaderValueRouter.java to support more header types that just String

    Thanks

    Keith

  • #2
    For 2.0, this is another place where we could use the Spring 3.0 ConversionService. Do you mind opening a JIRA issue for that?

    What version are you using? It wouldn't be too difficult to add pre-Spring 3.0 style TypeConversion for this (supporting boolean, numbers, etc) in the 1.0.x branch since the target type is always a String and hence manageable with simple PropertyEditors.

    Although I guess another option would be to allow a Map from any Object value->channel reference within the router.

    If you *are* using SI 2.0, the simplest thing you could do is have a <router/> with an "expression". For example, a ternary expression can be rather concise there.

    Comment


    • #3
      Jira issue has been created. https://jira.springsource.org/browse/INT-930

      I'm using SI 1.3 at the moment.

      Comment


      • #4
        Thank you Keith. I've set the target to 2.0 M3 for now. It might be possible to backport to 1.0.x as well, but I guess your interim solution router is fine in the mean time.

        If we do backport, it might be *equivalent functionality* but a different implementation. As you can imagine, with the core building on Spring 3.0 features (such as the ConversionService and Expression Language support), things are beginning to diverge between 1.0.x and 2.x.

        Thanks again,
        Mark

        Comment


        • #5
          I committed support for conversion to String. Please see the test cases associated with the JIRA issue for an example.

          Let me know if that works for your use-case.

          Thanks!
          Mark

          Comment

          Working...
          X