Announcement Announcement Module
No announcement yet.
header-value-router Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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 to support more header types that just String



  • #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.


    • #3
      Jira issue has been created.

      I'm using SI 1.3 at the moment.


      • #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,


        • #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.