title: How do I use a file inbound endpoint to process a file whose name I get from MuleClient.dispatch() as payload
body: <p>Below is my file inbound endpoint configuration. It is processing all .edi files available at the specified path.</p>
  
  <p><code>&lt;file:inbound-endpoint path="D:\test docs\in"
                    pollingFrequency="3000" responseTimeout="10000" doc:name="Incoming File"&gt;</code></p>
  
  <p><code>&lt;file:filename-regex-filter pattern="(.*).edi"
                          caseSensitive="false" /&gt;</code>
  </p>
  
  <p>I send an event to this endpoint from spring application as below </p>
  
  <p><code>muleClient.dispatch("file://D:/test docs/in", inputFileName,
                                null);</code></p>
  
  <p>I am passing the input file name as message1.edi. I want to restrict file inbound point to process single file whose name is sent as payload object in dispatch(). </p>
  
  <p>Is it possible with file inbound endpoint?</p>
  
  <p>Muleclient.dispatch() is an async method. I want to pause the current thread till i get reply from dispatch(). As of now i am using thread.sleep(). Is there any better approach?</p>