Http request endpoint with reponse

View: New views
3 Messages — Rating Filter:   Alert me  

Http request endpoint with reponse

by Gerwin Postma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to set up a Mule service that receives http requests, redirects them and then uses something received on an other endpoint as response to the htpp request.
Here is my configuration:

        <service name="IncommingHttpRequest">
            <inbound>
                <inbound-endpoint address="http://localhost:8889" transformer-refs="HttpRequestToMessageString" synchronous="true">
                    <not-filter>
                        <wildcard-filter pattern="/favicon.ico"/>  
                    </not-filter>
                </inbound-endpoint>
            </inbound>
            <outbound>
                     <pass-through-router>
                      <file:outbound-endpoint path="C:/log/out" outputPattern="test-#[COUNT].xml" connector-ref="writeConnector"/>                          
                     </pass-through-router>
            </outbound>
           
            <async-reply failOnTimeout="true" timeout="30000">
            <file:inbound-endpoint path="C:/log/inresponse" connector-ref="inboundFileConnector" transformer-refs="MessageToHttpResponse ObjectToString" />                                
            <single-async-reply-router />
            </async-reply>
        </service>
 
What I was hoping for was that Mule would receive on the http inbound and put it on a file on the outbound (and it does).
Then I put a file on the async inbound folder, and I was sort of hoping that the input would result in a http response. But the response never reaches the browser.
I haven't been able to find a god example of exactly what I am trying to do. Could any one give me some pointers.

/Trond

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Http request endpoint with reponse

by Gerwin Postma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What you are trying to do will not work, because the message you pick up from the file poller doesn't have the same Message ID / CorrrelationID. So it does not know which waiting thread it should return this answer.

Do you really need to do it this way? What is your use case?
If this is the only way, you could try to set the CorrelationID to the CorrelationID of the incoming message (by storing the correlationID in the file or filename and set that same ID on the file that is picked up from the polling file inbound endpoint. But something says me, there should be an easier solution (but again I don't know your use case exactly).

HTH
Mario

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Http request endpoint with reponse

by Gerwin Postma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for your reply.
It was the CorrelationID.
I made a service using a component to give a return, and it works fine.
Thanks.

/Trond

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email