Invoke Custom Java Class In Mule

 

In this tutorial we will demonstrate how can we Invoke Custom Java Class In Mule

Create a project in anypoint studio

Create Java Class in under src/main/java in anypoint studio

Invoke Custom Java Class In Mule

 

Set the input parameter as variable

 

Drag and drop the invoke static connector to call java class and configure the Java Class name as packagename.classname ,methodname and provide the arguments as shown below

Invoke Custom Java Class In Mule

 

Deploy the project and test

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
venkata
venkata
4 years ago

Very helpful and easy to understand the concepts. Thank you so much. Appreciated!!!

koala
koala
2 years ago

Fantasitc website for learning MuleEsb, thanks a lot!!!

Seemant Jain
Seemant Jain
1 year ago

Nice website for learning MuleSoft

Lawrence
Lawrence
3 months ago

I need to pass json payload received from rest api call to Java method which processes the response. Json payload can be 5 MB. I tried using InputStream as data type, however, got error “The value ‘{ medicationJson : vars.drugs}’ of type java.lang.String could not be transformed to the desired type java.util.Map [Not accessible. Value obtained from method: getDetailedDescription()]”

drugs is json array, {
“drug_code”: 225,
“class_name”: “Human”,
“drug_identification_number”: “00000019”,
“brand_name”: “PLACIDYL CAP 200MG”,
“descriptor”: “”,
“number_of_ais”: “1”,
“ai_group_no”: “0107593001”,
“company_name”: “ABBOTT LABORATORIES, LIMITED”,
“last_update_date”: “2008-07-23”
},

Suggestions?