Question

I want to access a Java class from within a Mule flow.

public class MyJava{
    private Map<String, String> unamePwdMap;

    public Map <String, String> getUnamePwdFromKey (String key){
            return unamePwdMap;
    }
}

Is this possible for Mule flow to call a method and send an argument and access a Java Map, extract values from the Map (knowing the hard-coded key).

(code shown here is just for understanding)

Was it helpful?

Solution

You can use java component in the flow example :-

< flow name="Db1Flow1" doc:name="Db1Flow1" > < http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP" />

< component doc:name="Java" class="MyJava"/ > < /flow >

Here class-="MyJava" is your java file

OTHER TIPS

You have to use the specific element to call your Java class. Something like this:

<custom-transformer class="<your Java class>" doc:name="<name to display>"/>

and include your Java class in the project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top