You may use an old version of Camel as we fixed this in CAMEL-6481. And I just added an unit test to test the int[]. https://github.com/apache/camel/commit/f554c483effb3342dde7ffcd04cf063f2e9887f8
On Sat, Oct 29, 2016 at 1:15 PM, Claus Ibsen <claus.ib...@gmail.com> wrote: > What version of Camel do you use? > > On Thu, Oct 20, 2016 at 9:47 PM, yxzhao <yxz...@stonewain.com> wrote: >> We have a camel route which uses the length of exchange message body to >> determine data types. It works fine when the body contains a string or array >> of objects, but if it contains array of primitive types, it only returns 1 >> as length. Below is a simplified version of the route: >> >> <route id="oceanview-test-body"> >> <from uri="timer://test?fixedRate=true&period=10000"/> >> <to uri="bean:utilBean?method=setDataInbody"/> >> <log loggingLevel="INFO" message="test data class ${body.class.name}, >> length [${body.length}]" logName="TEST"/> >> </route> >> >> I tried to set String, array of Strings, byte, int and Integer in method >> setDataInBody, the result from String, array of String and Integer are >> correct. For array of int and byte it always shows 1 as body.length. >> >> Does anyone know why arrays of primitive types don't return correct array >> length in camel exchange body? >> >> Thanks in advance! >> >> >> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Body-Object-in-Camel-Exchange-tp5789051.html >> Sent from the Camel - Users mailing list archive at Nabble.com. > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2