All,
In my sample code I am reading a json file and doing a jsonpath to do
content based routing.
Here is the simple route
from("file:src/data2/test.json?noop=true")
.choice()
.when(PredicateBuilder.isEqualTo(ExpressionBuilder.languageExpression("jsonpath",
"$.op"), ExpressionBuilder.constantExpression("i")))
.log("UK message")
.to("file:target/messages2/insert")
.otherwise()
.log("Other message")
.to("file:target/messages2/others");
The file contains the following json file
"ts": Timestamp(1415124334, 1),
"op": "i",
"ns": "test.products",
"o": {
"_id": ObjectId("5459156e7950e8c18c094992"),
"item": "card",
"qty": 15
The route has started according to the log but jsonpath does not work
What is wrong with my syntax?
Gordon
In my sample code I am reading a json file and doing a jsonpath to do
content based routing.
Here is the simple route
from("file:src/data2/test.json?noop=true")
.choice()
.when(PredicateBuilder.isEqualTo(ExpressionBuilder.languageExpression("jsonpath",
"$.op"), ExpressionBuilder.constantExpression("i")))
.log("UK message")
.to("file:target/messages2/insert")
.otherwise()
.log("Other message")
.to("file:target/messages2/others");
The file contains the following json file
"ts": Timestamp(1415124334, 1),
"op": "i",
"ns": "test.products",
"o": {
"_id": ObjectId("5459156e7950e8c18c094992"),
"item": "card",
"qty": 15
The route has started according to the log but jsonpath does not work
What is wrong with my syntax?
Gordon