Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

how do I transform a BSON into JSON using Camel message transformation pattern

$
0
0
All,
I am reading the oplog of Mongodb in my project in order to synch with
redis.
The BSON data I am capturing has the following format.

"ts": Timestamp(1415124334, 1),
"op": "i",
"ns": "test.products",
"o": {
"_id": ObjectId("5459156e7950e8c18c094992"),
"item": "card",
"qty": 15

The problem I am having is with the ts name:value pair.
As the data indicates it is not a json so I can not marshall/unmarshall it.
I do not care if the timestamp is there. So I want to know if there is a way
I can transform this bson data by removing the ts name: value pair by using
a Camel component? So the final data would look like this

"op": "i",
"ns": "test.products",
"o": {
"_id": ObjectId("5459156e7950e8c18c094992"),
"item": "card",
"qty": 15

and can be unmarshalled?
Gordon

Viewing all articles
Browse latest Browse all 5648

Trending Articles