You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/08/16 15:00:36 UTC

[jira] Created: (CAMEL-1915) Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message

Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message
------------------------------------------------------------------------------------------

                 Key: CAMEL-1915
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1915
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-core
    Affects Versions: 2.0-M3
            Reporter: Claus Ibsen
             Fix For: Future


Currently you can only use
- whenAnyExchangesRecevied(processor)
- whenExchangeReceieved(index, processor)

What would be neat is that you can use fluent builder to transform/set a canned reply when you use mock to simulate a real endpoint

Something like this:
- mock.returnReplyBody(constant("OK"));
- mock.replyBodyAndHeader("OK", "id", 123));

Or something like that.
Currently you *have* to use the Processor which can seem a bit low-level and Camel API centric. 

For instance using an expression you can invoke a bean to compute the reply
- mock.returnReplyBody(bean("replyGenerator"));

The method names might need a bit of name change but the concept is along the likes of what is described here

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


[jira] Updated: (CAMEL-1915) Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message

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

Willem Jiang updated CAMEL-1915:
--------------------------------

    Fix Version/s: 2.4.0
                       (was: Future)

> Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1915
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1915
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.4.0
>
>
> Currently you can only use
> - whenAnyExchangesRecevied(processor)
> - whenExchangeReceieved(index, processor)
> What would be neat is that you can use fluent builder to transform/set a canned reply when you use mock to simulate a real endpoint
> Something like this:
> - mock.returnReplyBody(constant("OK"));
> - mock.replyBodyAndHeader("OK", "id", 123));
> Or something like that.
> Currently you *have* to use the Processor which can seem a bit low-level and Camel API centric. 
> For instance using an expression you can invoke a bean to compute the reply
> - mock.returnReplyBody(bean("replyGenerator"));
> The method names might need a bit of name change but the concept is along the likes of what is described here

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


[jira] Commented: (CAMEL-1915) Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59634#action_59634 ] 

Willem Jiang commented on CAMEL-1915:
-------------------------------------

Just add returnReplyBody(Expression expression), and returnReplyHeader(String headerName, Expression expression) into MockEndpoint.
If you want to set the header and body at the same time, the best way is to use the customer Processor to do this job.

> Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1915
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1915
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.4.0
>
>
> Currently you can only use
> - whenAnyExchangesRecevied(processor)
> - whenExchangeReceieved(index, processor)
> What would be neat is that you can use fluent builder to transform/set a canned reply when you use mock to simulate a real endpoint
> Something like this:
> - mock.returnReplyBody(constant("OK"));
> - mock.replyBodyAndHeader("OK", "id", 123));
> Or something like that.
> Currently you *have* to use the Processor which can seem a bit low-level and Camel API centric. 
> For instance using an expression you can invoke a bean to compute the reply
> - mock.returnReplyBody(bean("replyGenerator"));
> The method names might need a bit of name change but the concept is along the likes of what is described here

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


[jira] Resolved: (CAMEL-1915) Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message

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

Willem Jiang resolved CAMEL-1915.
---------------------------------

    Resolution: Fixed

> Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1915
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1915
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.4.0
>
>
> Currently you can only use
> - whenAnyExchangesRecevied(processor)
> - whenExchangeReceieved(index, processor)
> What would be neat is that you can use fluent builder to transform/set a canned reply when you use mock to simulate a real endpoint
> Something like this:
> - mock.returnReplyBody(constant("OK"));
> - mock.replyBodyAndHeader("OK", "id", 123));
> Or something like that.
> Currently you *have* to use the Processor which can seem a bit low-level and Camel API centric. 
> For instance using an expression you can invoke a bean to compute the reply
> - mock.returnReplyBody(bean("replyGenerator"));
> The method names might need a bit of name change but the concept is along the likes of what is described here

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


[jira] Assigned: (CAMEL-1915) Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message

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

Willem Jiang reassigned CAMEL-1915:
-----------------------------------

    Assignee: Willem Jiang

> Mock endpoint - add whenAnyExchangeReceived using a DSL / expression to change the message
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-1915
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1915
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>    Affects Versions: 2.0-M3
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>             Fix For: 2.4.0
>
>
> Currently you can only use
> - whenAnyExchangesRecevied(processor)
> - whenExchangeReceieved(index, processor)
> What would be neat is that you can use fluent builder to transform/set a canned reply when you use mock to simulate a real endpoint
> Something like this:
> - mock.returnReplyBody(constant("OK"));
> - mock.replyBodyAndHeader("OK", "id", 123));
> Or something like that.
> Currently you *have* to use the Processor which can seem a bit low-level and Camel API centric. 
> For instance using an expression you can invoke a bean to compute the reply
> - mock.returnReplyBody(bean("replyGenerator"));
> The method names might need a bit of name change but the concept is along the likes of what is described here

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