You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Christian Mueller (JIRA)" <ji...@apache.org> on 2009/09/17 23:18:12 UTC

[jira] Created: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

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

                 Key: CAMEL-2023
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-velocity
         Environment: All
            Reporter: Christian Mueller
             Fix For: Future


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):

{code}
velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
{code}

and

{code}
velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
{code}

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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Mueller updated CAMEL-2023:
-------------------------------------

    Attachment: camel-velocity.patch
                camel-velocity-tests.patch

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>             Fix For: Future
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54324#action_54324 ] 

Christian Mueller commented on CAMEL-2023:
------------------------------------------

If you agree with this contribution, I would also update the camel-velocity component site to describe the new features (if anybody can tell me the svn url of this componets site)... :-)

Regards,
Christian

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>             Fix For: Future
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54390#action_54390 ] 

Claus Ibsen commented on CAMEL-2023:
------------------------------------

Christian, thanks for the patch and reporting the issue.

Glad you liked it and its useable for you.

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.1.0
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54387#action_54387 ] 

Christian Mueller commented on CAMEL-2023:
------------------------------------------

Hello Claus!

Your code looks nicer and more consistent than my code... :-)
Thank you for the quick reply and fix.

Regards,
Christian

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.1.0
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Christian Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54340#action_54340 ] 

Christian Mueller commented on CAMEL-2023:
------------------------------------------

Hello Claus!

Thank you for your quick reply. I think my explanation was too short...

In my project, the templates are stored in a database (because our customers have the possibility to change the templates with a custom build application at runtime) and we don't want to have to redeploy our service, whenever a template is modified. For this reason, we call a service which resolves the template to use, read the template from the database and adds it to the exchange in-message header. That's the reason, we need the functionality to read the "real" template (not the path to the template) from the exchange in-message header (or attachment).

Regards,
Christian

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>             Fix For: Future
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-2023.
--------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Future)
                   2.1.0
         Assignee: Claus Ibsen

Hi Christian

Thanks for the explanation. I did implement this a bit differently to be aligned with the recent implementation of the dynamic header.

You can now use the header name {{CamelVelocityTemplate}} to set a header with a template to use.

Wiki page updated.


trunk: 816861.

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>            Assignee: Claus Ibsen
>             Fix For: 2.1.0
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2023) Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54328#action_54328 ] 

Claus Ibsen commented on CAMEL-2023:
------------------------------------

Christian, see CAMEL-1850 which implements this.

> Allow the usage of velocity templates, which are placed/defined in the exchanges In message header or attachment
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2023
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2023
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-velocity
>         Environment: All
>            Reporter: Christian Mueller
>             Fix For: Future
>
>         Attachments: camel-velocity-tests.patch, camel-velocity.patch
>
>
> 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):
> {code}
> velocity://header:templateHeaderName respectively velocity:header:templateHeaderName
> {code}
> and
> {code}
> velocity://attachment:templateAttachmentName respectively velocity:attachment:templateAttachmentName
> {code}
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.