 <p>I am getting correct number with the following config:- </p> <pre><code> &lt;http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/&gt; &lt;flow name="Flow1" &gt; &lt;http:listener config-ref="HTTP_Listener_Configuration" path="/test" doc:name="HTTP"/&gt; &lt;json:json-to-object-transformer doc:name="JSON to Object" returnClass="java.util.HashMap"/&gt; &lt;logger message="Order size #[message.payload.orders.order.size()] " level="INFO" doc:name="Logger"/&gt; &lt;json:object-to-json-transformer doc:name="Object to JSON"/&gt; &lt;/flow&gt; </code></pre> <p>and yes, your JSON is incorrect.. It should be :- </p> <pre><code>{ "orders" : { "order" :[ { "id" : "4358153416", "fulfillment" : { "tracking_number" : "915", "line-items" : { "id" : "8367362760" } } }] } } </code></pre> <p>You have missed <strong>[</strong> after order</p>