title: How to use Mule Expression in JMS:selector
body: <p>I checked several previous discussions but couldnt find the answer.</p>
  
  <p>I am trying to achieve synchronous communicaiton using JMS back-channel (<a href="http://www.whishworks.com/blog/synchronous-communication-using-jms-back-channel" rel="nofollow">http://www.whishworks.com/blog/synchronous-communication-using-jms-back-channel</a>). Apart from the things mentioned in that site, I need to filter out the message from the inbound queue based on a dynamic Id. </p>
  
  <p>Following are my mule flows:</p>
  
  <pre><code>&lt;flow name="serverFlow" &gt;
      &lt;jms:inbound-endpoint doc:name="REQUEST" queue="REQUEST.QUEUE" connector-ref="jmsConnector"&gt;
              &lt;jms:selector expression="MULE_CORRELATION_ID='#[sessionVars.myCorrelationId]'"/&gt;
      &lt;/jms:inbound-endpoint&gt;     
  
      &lt;set-payload value="#[payload] + Hello World from Receiver" doc:name="Set Payload" /&gt;
  
      &lt;jms:outbound-endpoint doc:name="REPLY" queue="REPLY.QUEUE" connector-ref="jmsConnector" /&gt;
  &lt;/flow&gt;
  
   &lt;flow name="mainFlow" &gt;
      &lt;http:listener config-ref="HTTP_Listener_Configuration" path="/jms" allowedMethods="GET" doc:name="HTTP"/&gt;
      &lt;set-session-variable variableName="myCorrelationId" value="#[System.currentTimeMillis().toString()]" doc:name="Set Correlation ID"/&gt;       
     &lt;set-payload value="New message sent from Mule - mainFlow at #[new Date()]" doc:name="Set Message"/&gt;        
     &lt;set-property propertyName="MULE_CORRELATION_ID" value="#[sessionVars.myCorrelationId]" doc:name="Property"/&gt;  
      &lt;request-reply doc:name="Request-Reply"&gt;
          &lt;jms:outbound-endpoint doc:name="REQUEST" connector-ref="jmsConnector" queue="REQUEST.QUEUE"/&gt;
          &lt;jms:inbound-endpoint doc:name="REPLY" connector-ref="jmsConnector" queue="REPLY.QUEUE"/&gt;
      &lt;/request-reply&gt;        
      &lt;logger message="Reply to sender: #[message]" level="WARN" doc:name="Logger" /&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>If I try a static value like "&lt;jms:selector expression="MULE_CORRELATION_ID='12345'"/&gt;", it works. But if I try a dynamic ID using MEL, its not working. The MEL inside the jms selector expression is not working. The message stays at the queue as Unread. I used logs to see what the MULE_CORRELATION_ID is while being set at mainFlow and found the same value is set in the message that is UNREAD in the queue. So, I guess nothing is wrong in the way the MULE_CORRELATION_ID is set. The only problem is that MEL is not working within jms:selector.</p>
  
  <p>Could you please help how to get MEL working within JMS selector?</p>
  
  <p>Thank you very much.</p>