camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Cosentino <ancosen1...@yahoo.com.INVALID>
Subject Re: MongoDB / findById and ObjectId (issue in 2.18)
Date Thu, 03 Nov 2016 11:07:49 GMT
You're welcome to fill a JIRA for this if you think this is a bug.
 --
Andrea Cosentino 
----------------------------------
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix Committer
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd



On Thursday, November 3, 2016 11:56 AM, nbusy <nbusy@enfoll.com> wrote:
Hi All,

When using Camel MongoDB component with "operation=findById" and [_id] field
is happened to be a standard ObjectId(), it doesn't work anymore in v.2.18
(worked 2.17.3 and before).
Basically, to test you'd need to send org.bson.types.ObjectId in the message
body but it never finds a document.
The problem lies in MongoDbProducer.createDoFindById().
Fixed by replacing line:
                String id =
exchange1.getIn().getMandatoryBody(String.class);
with
                Object id = exchange1.getIn().getMandatoryBody();

My apologies if posted in a wrong forum.

Regards,
Nick



--
View this message in context: http://camel.465427.n5.nabble.com/MongoDB-findById-and-ObjectId-issue-in-2-18-tp5789685.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message