Am I doing anything wrong here? Even the json payload is [], it's going to the default instead of Error log.
<choice doc:name="If Payload is Null">
<when expression="#[payload == empty]">
<mule-logger-module:logger-exception message="Null Payload" doc:name="Log Error"/>
</when>
<otherwise>
<mule-logger-module:log-default message="Payload Received" type="EXIT" doc:name="Log End"/>
</otherwise>
</choice>
Convert to a Array of Maps first, then use the MEL expressions to test empty:
<json:json-to-object-transformer
returnClass="java.util.HashMap[]" doc:name="JSON to Object" />
<choice doc:name="If Payload is Null">
<when expression="#[payload == empty]">
<mule-logger-module:logger-exception message="Null Payload" doc:name="Log Error"/>
</when>
<otherwise>
<mule-logger-module:log-default message="Payload Received" type="EXIT" doc:name="Log End"/>
</otherwise>