0
votes

When trying a simple example of a mulesoft tutorial, I don't have the result as explained in the tutorial

tutorial link:

https://docs.mulesoft.com/mule-user-guide/v/3.3/configuring-an-endpoint

video link:

http://blogs.mulesoft.com/dev/anypoint-platform-dev/getting-started-with-mule-free-training-videos-tutorials/

Flow:

enter image description here

I have configured the HTTP Element like this:

enter image description here

and for the Listner:

enter image description here

but when I try in the browser to get:

http://localhost:8081/echo

this did not display /echo

it displays this message in the console:

INFO  2016-12-13 12:34:22,652 [[echo2].HTTP_Listener_Configuration.worker.01] org.mule.module.http.internal.listener.HttpListenerRegistry: No listener found for request: (GET)/echo

Does anyone have an idea ?

4
I would have thought that you would need to set the base path on the Http Listener to /echo - Dijkgraaf
I already tested that, but no result as well - HDJEMAI
when adding a logger between the HTTP and the echo its says the payload is null. - HDJEMAI
As you are doing a GET request, that would be expected for a request. Usually only POST & PUTs have payloads for the request - Dijkgraaf
The video link, says that from the browser when you try localhost:8081/echo , you are doing a get request, witch is true right ? - HDJEMAI

4 Answers

0
votes

Looks like you are referring to 3.3 version document / video tutorial. Seems you are using 3.8 version mule run time and latest any point studio, so refer to document for 3.8 version. May be features might have changed in newer version.

0
votes

Since echo component display the content of payload.Hence you are not able to see any thing in log.Also in the path instead of "/" you have to use "/*". Let me know the outcome of it.

0
votes

Finally I created the flow witch shows the Echo component in action in the latest mule version (3.8)

The Echo component is used to log the message and return the payload as result

Here is the working flow:

enter image description here

So I have added the transformer Set Payload to be able to set the payload with the received value and set it as following:

enter image description here

For the Echo component we have just to add it:

enter image description here

The HTTP Endpoint:

enter image description here

Result when tested with Firefox:

enter image description here

enter image description here

Note:

The Echo component is deprecated since mule ver. 3.5 but still work

enter image description here

0
votes

I recreated your application and it is because you are missing the path=/echo attribute on your http:listener component.

Please compare my working configurations.

<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="echo-testFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/echo" doc:name="HTTP"/>
    <logger message="Inside #[flow.name] with payload #[payload]" level="INFO" doc:name="Logger"/>
    <echo-component doc:name="Echo"/>
</flow>