camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Exchange property cannot be removed in method call
Date Wed, 14 Jan 2015 08:56:54 GMT
> .when(method(this, "removeMeProperty"))

is a predicate and it should not cause side effects.
Therefore its only for returning a boolean value, not changing messages

If you want to remove a property on the exchange use .removeProperty
or use a message transformation

On Wed, Jan 14, 2015 at 9:51 AM, horyna <phofficial@centrum.cz> wrote:
> Hi,
>
> using Camel 2.13.2. Problem:
> .setProperty("meProperty", "some old value")
> .choice()
> .when(method(this, "removeMeProperty"))
>                         .process(new Processor() {
>
>                                         @Override
>                                         public void process(Exchange exchange) throws
Exception {
>                                                 Object obj = exchange.getProperty("meProperty");
> // !!! meProperty has still old value. She was not removed from
> exch.properties. Where is this behavior described?
> // I can only set another value (not null) inside removeMeProperty, than obj
> contains a set value
>                                         }
>                                 })
> ----
> public boolean removeMeProperty(Exchange exch) {
>    exch.setProperty("meProperty", null);
>    return true;
> }
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exchange-property-cannot-be-removed-in-method-call-tp5761667.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message