I am trying to reply the basic Java Component Example from the Official Documentation:
https://docs.mulesoft.com/mule-user-guide/v/3.8/java-component-reference
The IDE is v.6.0.1
I realized that the Java class should extend Callable. This is mainly the big difference with previous versions of MULE. So in my case
package javacomponent;
import org.mule.api.MuleEventContext;
import org.mule.api.lifecycle.Callable;
public class helloWorldComponent implements Callable{
@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
eventContext.getMessage().setInvocationProperty("myProperty", "Hello World!");
return eventContext.getMessage().getPayload();
}
}
The problem I have is that after running the app and making a http/get to localhost:8081 I can't se the Hello World! message rendered in the browser.
Has something changed in last version? Should I incluse a setPayload element also?