You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Damage_Shadow <sc...@outlook.com> on 2016/10/12 13:49:00 UTC

MockEndpoint can either returnReplyBody or returnReplyHeader not both

Is there any way to return whole message with body and headers in case of
mocked endpoint org.apache.camel.component.mock.MockEndpoint. I can see only 

/**
     * Set the expression which value will be set to the message body
     * @param expression which is use to set the message body 
     */
    public void returnReplyBody(Expression expression) {
        this.defaultProcessor = ProcessorBuilder.setBody(expression);
    }
    
    /**
     * Set the expression which value will be set to the message header
     * @param headerName that will be set value
     * @param expression which is use to set the message header 
     */
    public void returnReplyHeader(String headerName, Expression expression)
{
        this.defaultProcessor = ProcessorBuilder.setHeader(headerName,
expression);
    }
    



--
View this message in context: http://camel.465427.n5.nabble.com/MockEndpoint-can-either-returnReplyBody-or-returnReplyHeader-not-both-tp5788688.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MockEndpoint can either returnReplyBody or returnReplyHeader not both

Posted by Claus Ibsen <cl...@gmail.com>.
There is a whenAnyExchangeReceived / whenExchangeReceived you can use
with a processor where you can change the exchange as you like

On Wed, Oct 12, 2016 at 3:49 PM, Damage_Shadow <sc...@outlook.com> wrote:
> Is there any way to return whole message with body and headers in case of
> mocked endpoint org.apache.camel.component.mock.MockEndpoint. I can see only
>
> /**
>      * Set the expression which value will be set to the message body
>      * @param expression which is use to set the message body
>      */
>     public void returnReplyBody(Expression expression) {
>         this.defaultProcessor = ProcessorBuilder.setBody(expression);
>     }
>
>     /**
>      * Set the expression which value will be set to the message header
>      * @param headerName that will be set value
>      * @param expression which is use to set the message header
>      */
>     public void returnReplyHeader(String headerName, Expression expression)
> {
>         this.defaultProcessor = ProcessorBuilder.setHeader(headerName,
> expression);
>     }
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MockEndpoint-can-either-returnReplyBody-or-returnReplyHeader-not-both-tp5788688.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2