title: Mule - unable to route message based on http.status
body: <p>I'm trying to create a choice router in my Mule application that will do something based on the response code received from an HTTP Outbound Endpoint. My config is as below - I followed the answers provided in <a href="https://stackoverflow.com/questions/16482500/mule-how-to-do-a-choice-when-based-on-http-response-codes">this previous question</a>:</p>
  
  <pre><code>&lt;set-variable variableName="http.disable.status.code.exception.check" value="true" doc:name="Variable"/&gt;
  &lt;http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="hello" contentType="text/xml" method="POST" doc:name="HTTP"/&gt;
  
  &lt;logger level="INFO" doc:name="Logger"/&gt;
  
  &lt;choice doc:name="Choice"&gt;
      &lt;when expression="#[message.inboundProperties['http.status']] == 200"&gt;
          &lt;logger level="DEBUG" message="HTTP SUCCESS" doc:name="Debug"/&gt;
      &lt;/when&gt;
      &lt;otherwise&gt;
          &lt;logger level="DEBUG" message="HTTP FAILURE" doc:name="Debug"/&gt;                 
      &lt;/otherwise&gt;
  &lt;/choice&gt;
  </code></pre>
  
  <p>Yet, I get the following error:</p>
  
  <pre><code>********************************************************************************
  Message               : Execution of the expression "message.inboundProperties['http.status']] == 20" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: ReleasingInputStream
  Code                  : MULE_ERROR--2
  --------------------------------------------------------------------------------
  Exception stack is:
  1. [Error: could not access: ]; in class: java.lang.String]
  [Near : {... message.inboundProperties['htt ....}]
               ^
  [Line: 1, Column: 1] (org.mvel2.PropertyAccessException)
    org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer:690 (null)
  2. Execution of the expression "message.inboundProperties['http.status']] == 20" failed. (org.mule.api.expression.ExpressionRuntimeException)
    org.mule.el.mvel.MVELExpressionLanguage:218 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html)
  3. Execution of the expression "message.inboundProperties['http.status']] == 20" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: ReleasingInputStream (org.mule.api.MessagingException)
    org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:35 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
  --------------------------------------------------------------------------------
  Root Exception stack trace:
  [Error: could not access: ]; in class: java.lang.String]
  [Near : {... message.inboundProperties['htt ....}]
               ^
  [Line: 1, Column: 1]
      at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:690)
      at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanPropertyAO(ReflectiveAccessorOptimizer.java:472)
      at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:374)
      + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
  ********************************************************************************
  </code></pre>
  
  <p>The http.status inbound property is clearly in the scope as the output from my logger immediately before the choice router is as below:</p>
  
  <pre><code>{
    id=dece5e82-db50-11e3-94e6-9552f33cb636
    payload=org.mule.transport.http.ReleasingInputStream
    correlationId=&lt;not set&gt;
    correlationGroup=-1
    correlationSeq=-1
    encoding=UTF-8
    exceptionPayload=&lt;not set&gt;
  
  Message properties:
    INVOCATION scoped properties:
      http.disable.status.code.exception.check=true
      http.method=POST
    INBOUND scoped properties:
      Connection=true
      Content-Length=0
      Content-Type=text/plain
      Date=Wed, 14 May 2014 11:16:53 +0100
      Keep-Alive=true
      Server=Mule Core/3.4.0
      http.headers={Date=Wed, 14 May 2014 11:16:53 +0100, Content-Length=0, Keep-Alive=true, Connection=true, Content-Type=text/plain, Server=Mule Core/3.4.0}
      http.method=POST
      http.query.params={}
      http.query.string=
      http.request=http://localhost:8081/hello
      http.status=200
      http.version=HTTP/1.1
    OUTBOUND scoped properties:
      MULE_ENCODING=UTF-8
      MULE_SESSION=rO0ABXNyACNvcmcubXVsZS5zZXNzaW9uLkRlZmF1bHRNdWxlU2Vzc2lvbi7rdtEW7GGKAwAEWgAFdmFsaWRMAA1mbG93Q29uc3RydWN0dAAmTG9yZy9tdWxlL2FwaS9jb25zdHJ1Y3QvRmxvd0NvbnN0cnVjdDtMAAJpZHQAEkxqYXZhL2xhbmcvU3RyaW5nO0wAD3NlY3VyaXR5Q29udGV4dHQAJ0xvcmcvbXVsZS9hcGkvc2VjdXJpdHkvU2VjdXJpdHlDb250ZXh0O3hwAXB0ACRkZWJiYzBjYi1kYjUwLTExZTMtOTRlNi05NTUyZjMzY2I2MzZwc3IAJWphdmEudXRpbC5Db2xsZWN0aW9ucyRTeW5jaHJvbml6ZWRNYXAbc/kJS0s5ewMAAkwAAW10AA9MamF2YS91dGlsL01hcDtMAAVtdXRleHQAEkxqYXZhL2xhbmcvT2JqZWN0O3hwc3IAJG9yZy5tdWxlLnV0aWwuQ2FzZUluc2Vuc2l0aXZlSGFzaE1hcJ3R2e9nRc4AAwAAeHB3DD9AAAAAAAAQAAAAAHhxAH4ACXh4
    SESSION scoped properties:
  }
  </code></pre>
  
  <p>Can anyone identify why I'm having this issue? Thanks in advance.</p>