setting body property on the exchange failing unless log() message happens beforehand

2015-07-28 Thread Dan Moore
Hi folks,

I have an object coming in to the exchange from a direct route.

from("direct:test2")
//.log("plain message")
//.log(LoggingLevel.INFO, log, "this is a test 2" )
.setProperty("origMsg", body()) // Store the Original Message
.log(LoggingLevel.INFO, log, "body saved off:
${exchangeProperty.origMsg}" )
.end();

If either of the first two log statements are uncommented, then the final
log statement succeeds--the origMsg is placed on the exchange in a property
(it's a serializable pojo, if that matters).

However, if the first two log statements are commented out, as above, then
the output looks like:

12:35:27.246 [qtp173207982-22] INFO  MyRoute [CamelLogger.java:176] - body
saved off:

That is, the body is blank.

If I place a delay() between the from() and setProperty(), that also fails:

from("direct:test2")
.delay(1000)
.setProperty("origMsg", body()) // Store the Original Message
.log(LoggingLevel.INFO, log, "body saved off:
${exchangeProperty.origMsg}" )
.end();

I am using java8/camel 2.15.2, and have confirmed the behavior on windows
and macos.

It seems to me that log() returns 'this', that is the ProcessorDefinition,
while from() returns a subclass of ProcessorDefinition, and that might be
causing setProperty() to be set on a different object.  But that is pure
speculation.

Am I using setProperty incorrectly?  What am I missing?

Thanks,
Dan


Re: using basic auth to protect camel rest dsl routes

2015-06-12 Thread Dan Moore
Hi folks,

I also ended up using Spring Security for basic auth as well, and
documented how to do so on this SO question:
http://stackoverflow.com/a/30809119/203619

On Thu, Jun 11, 2015 at 11:13 PM, Dan Moore  wrote:

> Hi folks,
>
> After banging my head for a bit, I wrote a blog post about using basic
> auth to protect rest dsl routes served using jetty:
>
> http://www.mooreds.com/wordpress/archives/2065
>
> Would love any feedback.
>
> Thanks,
> Dan
>


Re: Deploying REST service on running camel:jetty instance

2015-06-12 Thread Dan Moore
Hi,

Can you be more specific?  I don't understand what you are trying to do.

Dan

On Wed, Jun 10, 2015 at 4:44 AM, Chandana  wrote:

> Is there a way to expose 2 restful web services from same camel route with
> the same base URI in a web container (Jetty in this case)?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Deploying-REST-service-on-running-camel-jetty-instance-tp5746625p5768066.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


using basic auth to protect camel rest dsl routes

2015-06-11 Thread Dan Moore
Hi folks,

After banging my head for a bit, I wrote a blog post about using basic auth
to protect rest dsl routes served using jetty:

http://www.mooreds.com/wordpress/archives/2065

Would love any feedback.

Thanks,
Dan


Re: Is there a tools to convert java dsl to xml ?

2015-06-09 Thread Dan Moore
I also am a new user and tend to like XML.  Maybe that will change as I get
used to Camel.

I don't know of any automated way, but you can get edit access to camel and
make the changes yourself:
http://camel.apache.org/how-do-i-edit-the-website.html

Dan

On Tue, Jun 9, 2015 at 3:11 AM, cloud  wrote:

> hi team,
>
> Is there a tools to convert java dsl to xml ?
> Is every java dsl code  have a equal xml counterpart?
>
> When I am reading the camel document's , there are many snippets code that
> writen by java dsl .
>
> As a new user , sometimes I have to use xml instead of java dsl  .
>
> In fact , I want to know how could I convert the below code to xml
>
> from("direct:start")
>   .setHeader("decisionSlip").method(OrderProcessorBean.class,
> "calculateRoute")
>   .routingSlip("decisionSlip");
>
>
> thanks.
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Is-there-a-tools-to-convert-java-dsl-to-xml-tp5768015.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>