Claus Ibsen created CAMEL-27259:
-----------------------------------

             Summary: camel-mongodb - insert of a byte[] body fails with 
ClassCastException
                 Key: CAMEL-27259
                 URL: https://issues.apache.org/jira/browse/CAMEL-27259
             Project: Camel
          Issue Type: Bug
          Components: camel-mongodb
            Reporter: Claus Ibsen


{{MongoDbProducer}} (insert) checks {{insert.getClass().isArray()}} and casts 
the body to {{Object[]}}. A {{byte[]}} body, such as JSON text from a Kafka 
consumer or a source with the {{binary}} data type, is an array but not an 
{{Object[]}}, so the insert fails: {{ClassCastException: class [B cannot be 
cast to class [Ljava.lang.Object;}}.

Expected: a {{byte[]}} body is converted like a String, as JSON text to a 
Document. Only an {{Object[]}} (or a List) is a batch insert.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to