Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-2028 camel-freemarker - Add feature to use a template from a header as CAMEL-2023
  3. CAMEL-2023

Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.1.0
    • camel-velocity
    • None
    • All

    • Patch Available

    Description

      It would be nice, if the camel-velocity component also read templates from the exchange In message header or attachment. We could define this with following uri's (like in the camel-mina component):

      velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
      

      and

      velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
      

      I need this flexibility in a project, because the template, which we have to use, must be calculated at runtime and depends on some attributes of the message In body like:

      • Which event has triggered this exchange?
      • Which customer will receive this message?
      • Which protocol is used (smtp, smpp, xmpp, ...)?

      I add a more technical description of my requirements in form of four unit tests (see camel-velocity-tests.patch).

      The second attachment (camel-velocity.patch) contains the patch, which I have developed to fulfill my requirements. I hope with this contribution, I can make camel a little bit better, than this great framework is already.

      Regards,
      Christian

      Attachments

        1. camel-velocity.patch
          5 kB
          Christian Müller
        2. camel-velocity-tests.patch
          12 kB
          Christian Müller

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              muellerc Christian Müller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: