1 Reply Latest reply on Apr 12, 2011 6:00 AM by Claus Ibsen

    calling object method in a camel route that is in the body of the exchange

    mahmud fatafta Newbie

      I have a the following class;

      class X {

          private String name = "MyName";

          public void setName( String name ) {

              this.name = name;

          }

          public String getName() {

              return name;

          }

      }

       

      and if I have a copy or object of this class in a body of a camel exchange, how can I call the method getName() from within a camel route?

      Is it possible?

       

      I am trying to set a property in the exchange with the value that the getName method returns?

      Something like the following?

      from ( "...." )

          .setProperty( "name" ).body(X.class).getName()

      ;