You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Craig Taylor <ct...@ctalkobt.net> on 2015/07/24 22:13:56 UTC

Placing and referencing DTO via exchange properties

I'm attempting the following route given a TestDTO implemented which has a
constructor / getter / setter for a name property:


                from ("direct:testDTO")
                    .setProperty("testDTO",bean(testDTO))
                    .to("direct:testDTO2");

                from ("direct:testDTO2")
                    .log(LoggingLevel.ERROR, "testDTO property is : ${
property.testDTO.name}")
                    ;

The logging output yields only

[                          main] route2                         ERROR
testDTO property is :

I've tried a number of other types of placement such as constant() etc in
place of bean with the same results.

Thoughts / Suggestions?

(I'm really trying to avoid placing the individual elements of the DTO on
the exchange as there will be a large number of them and the existing /
intended business services are already focused around usage of a DTO
reference.  I'm using a property rather than a header due the fact that the
body itself will undergo a number of different changes).
-- 
-------------------------------------------
Craig Taylor
ctalkobt@ctalkobt.net

Re: Placing and referencing DTO via exchange properties

Posted by Craig Taylor <ct...@ctalkobt.net>.
Please ignore - problem ended up being that the @Before was not being
called prior to the createRouteBuilder() within CamelTestSupport.

This is w/ Camel-Test 2.8.1.   Not sure that should be expected behavior
but I've gotten around the issue by initializing it w/ in the
createRouteBuilder.

On Fri, Jul 24, 2015 at 4:13 PM, Craig Taylor <ct...@ctalkobt.net> wrote:

> I'm attempting the following route given a TestDTO implemented which has a
> constructor / getter / setter for a name property:
>
>
>                 from ("direct:testDTO")
>                     .setProperty("testDTO",bean(testDTO))
>                     .to("direct:testDTO2");
>
>                 from ("direct:testDTO2")
>                     .log(LoggingLevel.ERROR, "testDTO property is : ${
> property.testDTO.name}")
>                     ;
>
> The logging output yields only
>
> [                          main] route2                         ERROR
> testDTO property is :
>
> I've tried a number of other types of placement such as constant() etc in
> place of bean with the same results.
>
> Thoughts / Suggestions?
>
> (I'm really trying to avoid placing the individual elements of the DTO on
> the exchange as there will be a large number of them and the existing /
> intended business services are already focused around usage of a DTO
> reference.  I'm using a property rather than a header due the fact that the
> body itself will undergo a number of different changes).
> --
> -------------------------------------------
> Craig Taylor
> ctalkobt@ctalkobt.net
>



-- 
-------------------------------------------
Craig Taylor
ctalkobt@ctalkobt.net