camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simeon667 <simeon.pet...@gmail.com>
Subject Simple
Date Fri, 29 Oct 2010 18:15:22 GMT


Hi there,

I seem to have some basic understanding problem of Simple evaluations and it
looks like I'm done searching the official docs without any success. Help
appreciated.

Code:

1 from("timer://twoSecTimer?fixedRate=true&period=60000")
2                .to("sql:select * from messages?dataSourceRef=myDS")
3                .split(body())
4                .to("log:org.apache.camel?level=DEBUG")
5                .setHeader("partnerName",
ExpressionBuilder.simpleExpression("${body[name]}"))
6               
.enrich("restlet:http://localhost:8081/PartnerStatus/resources/partnerStatus/{partnerName}?restletMethod=get",
new PartnerStatusAggregationStrategy())
7                .to("log:org.apache.camel?level=DEBUG");

The query results in an Exchange like this:

Exchange[BodyType:java.util.LinkedHashMap, Body:{id=0, sender=Sting,
severity=0, message=Desert Rose, received=2010-10-29 13:08:14.0}]

1. Question: Why does line 5 result in ExpressionIllegalSyntaxException:
Illegal syntax: body[name]. The body is a map, so why can't I lookup a value
by [key]?

2. Question: Why doesn't the Simple expression in line 6
(...{partnerName}...) get substituted. No matter if I prepend a $ - it
doesn't. I did fix the issue from Question 1 by putting a constant as a
header value - no success ...

Thanks in advance!

Best,
Simeon



-- 
View this message in context: http://camel.465427.n5.nabble.com/Simple-tp3242568p3242568.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message