Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7040

Support calling OGNL expressions on headers accessed using in.headers[header.name] expression?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 2.12.2
    • None
    • camel-core
    • Unknown

    Description

      After spending a while trying to figure out how to get Camel to call an OGNL expression on a bean in the Exchange headers with the Simple Language, I discovered that I had gone about it completely the wrong way.

      What I have is a header, "soap.headers.blah", which is an object. I wanted to access a property, prop, on that header.

      Initially I tried ${in.headers.soap.headers.blah.prop}, which didn't work.

      I then spent quite a bit of time trying variations on ${in.headers[soap.headers.blah].prop}, none of which worked. Now, the documentation never said that what I was trying to do would work, so I only have myself to blame for that, but I think it would be quite nice if the second form did work, so that in addition to having the following:

      code
      header.foo.OGNL
      in.header.foo.OGNL
      in.headers.foo.OGNL
      code

      I could also do

      code
      header[foo.bar].OGNL
      in.header[foo.bar].OGNL
      in.headers[foo.bar].OGNL
      code

      I don't know what this involves - I suspect it's not terribly straightforward - but it would be nice to have an option for accessing properties on headers whose names include periods.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            ipsi Andrew
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: