SlideShare a Scribd company logo
29th March 2021 , 4pm IST
Hyderabad MuleSoft Meetup
MIGRATING MULE 3 JAVA RELATED CODE TO MULE 4
Agenda
•Community Details!
•Introduction Of Organizers and Speakers
•Important Announcements – Anypoint Studio New Release
•Migrating Mule 3 Java Related Code to Mule 4 by Piyush Sharma
•Queries
•Trivia Quiz
2
Community Details
• Register for Meetups : https://meetups.mulesoft.com
•Register for Official Training platform : https://training.mulesoft.com
•MuleSoft forum : https://help.mulesoft.com
•For all blogs : https://blogs.mulesoft.com/
•Anypoint platform : https://anypoint.mulesoft.com
•Join Exam Readiness Sessions ! (Remind me to share at the end of the session)
3
Hyderabad Meetup Leaders
4
Speaker of the day!
5
• Working as an Integration developer with 5+ years’
of experience in different domains like retail,
banking, consumer goods, healthcare etc and
helping organizations in their digital transformation
journey.
• Started career with TIBCO and slowly moved to
MuleSoft.
• Happy to help and contribute to MuleSoft
community and eventually learning new things in
process. Love to travel and watch movies in free
time.
Reachable:
https://www.linkedin.com/in/piyush3192/
Anypoint Studio Latest Release
2
New Anypoint Studio 7.9.0
• Anypoint Studio 7.9 enables users to use a dark theme, and upgrades its
underlying infrastructure to Eclipse 4.18 and Java 11, adding official
support for macOS Big Sur.
• This version also introduces improvements for Dataweave code
experience and enhanced macOS experience by notarizing Studio as a
macOS application.
2
New Anypoint Studio 7.9.0
By Piyush Sharma,
Sr.Integration Developer at Billennium
Mule 3 Java code Migration to Mule 4
10
Some Comparisons from Mule 3 to Mule 4
11
Some Comparisons from Mule 3 to Mule 4
12
Mule 3 Java Working
13
Mule 3 Java Working
14
Mule 4 Java Working
Several ways of calling Java:
• Calling Static Java Methods from DataWeave
• Scripting Module (Ruby, Python,Groovy,JS)
• Java Module
15
A look on Mule 3 Java Code
15
Mule API Packages
Callable Interface
Getting payload and flow
variables
Setting flow variables and
return payload
16
16
Basic knowledge of Mule 3 Java class
Mule API Package Imports:
import org.mule.api.lifecycle.Callable;
import org.mule.api.MuleEventContext;
import org.mule.api.transport.PropertyScope;
Class with callable interface:
public class AddtwoNum implements Callable
Oncall method
@Override
public Object onCall(MuleEventContext eventContext) throws Exception
17
17
Basic knowledge of Mule 3 Java class
Read flow Variables according to their scope:
myVar = eventContext.getMessage().getProperty(“name", PropertyScope.INVOCATION);
Set flow Variables according to their scope:
eventContext.getMessage().setProperty(“name", “Max”, PropertyScope.INVOCATION);
Read payload:
String payload = (String) eventContext.getMessage().getPayload();
Return payload:
return eventContext.getMessage().getPayload();
18
18
Migrating Java functionality Mule 3 to Mule 4
Combined Approach:
• Java classes cannot be simply migrated, requires manual efforts.
• Utilize MMA tool along with custom changes.
• Migrate most of the code and connector configuration using MMA.
Identify and Address:
• Identify Java classes which you really need to migrate.
• Utilize Dataweave 2.0 at most of the places and scrap the old used java class for data
transformation for improved performance and readability.
• List down the java classes which have to be migrated.
19
19
Migrating Java functionality Mule 3 to Mule 4
Work with classes:
• Once class finalized, start importing them. Please watch out for classes which import other classes
as well.
• Fix project structure and error, you might require to add dependency which are used in java class.
• Sometimes you need to allow certain packages in studio which gets restricted.
• After importing classes, there will be errors in classes as well, that’s where the manual efforts needs
to be done.
20
20
Migrating Java functionality Mule 3 to Mule 4
Modify classes:
• Remove all imports related to org.mule.api.*, as they are no longer supported in Mule 4.
• Remove callable interface notation from class declaration(public class AddTwoNum implements Callable ->
public class AddTwoNum )
• Modify onCall method , rename it and make it static.
• Check for flow variables or properties which code reads, you now need to pass them as a parameters in
static method.
• Check for return type of method, if it doesn’t return anything it will be void, otherwise based on return
datatype.
Demo
Queries?
Maintenance Exams?
Trivia Quiz !
Enter Your Full Valid Name (no nick Names are allowed)
Only those who have registered and joined the session will be
allowed!
Goto Mobile Browser
Enter :
kahoot.it
Read the options and Tap the colour which
has correct answer.
Thank you

More Related Content

What's hot

Mulesoft KL Meetup 2
Mulesoft KL Meetup 2Mulesoft KL Meetup 2
Mulesoft KL Meetup 2
NitushreeJena
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Subhash Patel
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handling
Manish Kumar Yadav
 
Meet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalMeet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_final
Akshata Sawant
 
MuleSoft Meetup Warsaw Group #1
MuleSoft  Meetup Warsaw Group #1MuleSoft  Meetup Warsaw Group #1
MuleSoft Meetup Warsaw Group #1
Patryk Bandurski
 
MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019
Ieva Navickaite
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Shekh Muenuddeen
 
Custom policies in mule 4 and a circuit breaker example
Custom policies in mule 4 and a circuit breaker exampleCustom policies in mule 4 and a circuit breaker example
Custom policies in mule 4 and a circuit breaker example
Royston Lobo
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Sabrina Marechal
 
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Manish Kumar Yadav
 
How to Secure Mule API's With a Demo
How to Secure Mule API's With a DemoHow to Secure Mule API's With a Demo
How to Secure Mule API's With a Demo
ManjuKumara GH
 
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
Manish Kumar Yadav
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Manish Kumar Yadav
 
Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020
D.Rajesh Kumar
 
MuleSoft CloudHub API Versioning
MuleSoft CloudHub API VersioningMuleSoft CloudHub API Versioning
MuleSoft CloudHub API Versioning
Patryk Bandurski
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
Guilherme Pereira Silva
 
Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
Amit Singh
 
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
Jitendra Bafna
 

What's hot (18)

Mulesoft KL Meetup 2
Mulesoft KL Meetup 2Mulesoft KL Meetup 2
Mulesoft KL Meetup 2
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
 
Mulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handlingMulesoft meetup slides mumbai_20113019_exception_handling
Mulesoft meetup slides mumbai_20113019_exception_handling
 
Meet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalMeet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_final
 
MuleSoft Meetup Warsaw Group #1
MuleSoft  Meetup Warsaw Group #1MuleSoft  Meetup Warsaw Group #1
MuleSoft Meetup Warsaw Group #1
 
MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019MuleSoft Manchester Meetup #2 slides 29th October 2019
MuleSoft Manchester Meetup #2 slides 29th October 2019
 
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalertsAhmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
Ahmadabad mule soft_meetup_11_october_2020_errorhanlingandmonitoringalerts
 
Custom policies in mule 4 and a circuit breaker example
Custom policies in mule 4 and a circuit breaker exampleCustom policies in mule 4 and a circuit breaker example
Custom policies in mule 4 and a circuit breaker example
 
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECTFlow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
Flow Tuning: Mule 3 vs. Mule 4 - MuleSoft Chicago CONNECT
 
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
Mumbai MuleSoft Meetup:Batch Processing, Anypoint Messaging Queue and Custom ...
 
How to Secure Mule API's With a Demo
How to Secure Mule API's With a DemoHow to Secure Mule API's With a Demo
How to Secure Mule API's With a Demo
 
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
MuleSoft Meetup slides_kualalumpur_19thSept_Undisturbed REST: Achieving Undis...
 
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
Clustering, Server setup and Hybrid deployment setup using Anypoint Runtime M...
 
Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020Mule soft meetup_-_finland_july_11th__2020
Mule soft meetup_-_finland_july_11th__2020
 
MuleSoft CloudHub API Versioning
MuleSoft CloudHub API VersioningMuleSoft CloudHub API Versioning
MuleSoft CloudHub API Versioning
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
 
Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in Mulesoft
 
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
MuleSoft Surat Virtual Meetup#25 - Anypoint Platform Features and Capabilitie...
 

Similar to Hyd MuleSoft-Meetup-May 29,2021 | Migrating Mule 3 Java related code to Mule 4

Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup
Rajesh Maheshwari
 
Meetup hyderabad mule-4.x
Meetup hyderabad mule-4.xMeetup hyderabad mule-4.x
Meetup hyderabad mule-4.x
Santosh Ojha
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
Subhash Patel
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
Amit Singh
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
Sunil Kumar
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
Stephen Fuqua
 
Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018
Ryan Anthony Andal
 
MuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesMuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation Slides
Subhash Patel
 
Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1
Wojtek Maciejczyk
 
Mule soft meetup warsaw november 13th, 2019
Mule soft meetup   warsaw november 13th, 2019Mule soft meetup   warsaw november 13th, 2019
Mule soft meetup warsaw november 13th, 2019
Patryk Bandurski
 
Java modulesystem
Java modulesystemJava modulesystem
Java modulesystem
Marc Kassis
 
CPAN Curation
CPAN CurationCPAN Curation
CPAN Curation
neilbowers
 
Mule 4 vanrish
Mule 4   vanrishMule 4   vanrish
Mule 4 vanrish
Rajnish Kumar
 
Mule esb munit
Mule esb munitMule esb munit
Mule esb munit
D.Rajesh Kumar
 
Mulesoft Meetup Bangalore - 6th March 2021
Mulesoft Meetup Bangalore -  6th March 2021Mulesoft Meetup Bangalore -  6th March 2021
Mulesoft Meetup Bangalore - 6th March 2021
Gaurav Sethi
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
Robert Scholte
 
Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
Alexandra N. Martinez
 
Custom Connector development using Mule SDK
Custom Connector development using Mule SDKCustom Connector development using Mule SDK
Custom Connector development using Mule SDK
Navin Kare
 
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
How to Expand Anypoint Platform's Capabilities by Developing Custom ConnectorsHow to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
AaronLieberman5
 
Continuous Integration: Improving Quality in Moodle
Continuous Integration: Improving Quality in Moodle Continuous Integration: Improving Quality in Moodle
Continuous Integration: Improving Quality in Moodle
Dan Poltawski
 

Similar to Hyd MuleSoft-Meetup-May 29,2021 | Migrating Mule 3 Java related code to Mule 4 (20)

Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup Ahmedabad MuleSoft 3rd Meetup
Ahmedabad MuleSoft 3rd Meetup
 
Meetup hyderabad mule-4.x
Meetup hyderabad mule-4.xMeetup hyderabad mule-4.x
Meetup hyderabad mule-4.x
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.X
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotation
 
Refactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test AutomationRefactoring Legacy Web Forms for Test Automation
Refactoring Legacy Web Forms for Test Automation
 
Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018
 
MuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesMuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation Slides
 
Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1Cracow MuleSoft Meetup #1
Cracow MuleSoft Meetup #1
 
Mule soft meetup warsaw november 13th, 2019
Mule soft meetup   warsaw november 13th, 2019Mule soft meetup   warsaw november 13th, 2019
Mule soft meetup warsaw november 13th, 2019
 
Java modulesystem
Java modulesystemJava modulesystem
Java modulesystem
 
CPAN Curation
CPAN CurationCPAN Curation
CPAN Curation
 
Mule 4 vanrish
Mule 4   vanrishMule 4   vanrish
Mule 4 vanrish
 
Mule esb munit
Mule esb munitMule esb munit
Mule esb munit
 
Mulesoft Meetup Bangalore - 6th March 2021
Mulesoft Meetup Bangalore -  6th March 2021Mulesoft Meetup Bangalore -  6th March 2021
Mulesoft Meetup Bangalore - 6th March 2021
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
 
Online Spanish meetup #1
Online Spanish meetup #1Online Spanish meetup #1
Online Spanish meetup #1
 
Custom Connector development using Mule SDK
Custom Connector development using Mule SDKCustom Connector development using Mule SDK
Custom Connector development using Mule SDK
 
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
How to Expand Anypoint Platform's Capabilities by Developing Custom ConnectorsHow to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
 
Continuous Integration: Improving Quality in Moodle
Continuous Integration: Improving Quality in Moodle Continuous Integration: Improving Quality in Moodle
Continuous Integration: Improving Quality in Moodle
 

More from Sravan Lingam

Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-MonitoringPrinceton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Sravan Lingam
 
MuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptxMuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptx
Sravan Lingam
 
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptxPrinceton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Sravan Lingam
 
Toronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptxToronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptx
Sravan Lingam
 
Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022
Sravan Lingam
 
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
Sravan Lingam
 
Hyderabad meet up-sep12
Hyderabad meet up-sep12Hyderabad meet up-sep12
Hyderabad meet up-sep12
Sravan Lingam
 

More from Sravan Lingam (7)

Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-MonitoringPrinceton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
Princeton-NJ-Meetup-Troubleshooting-with-AnyPoint-Monitoring
 
MuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptxMuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptx
 
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptxPrinceton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
 
Toronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptxToronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptx
 
Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022
 
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
Hyderabad MuleSoft Meetup - Anypoint Studio Tips and Tricks & Salesforce Comp...
 
Hyderabad meet up-sep12
Hyderabad meet up-sep12Hyderabad meet up-sep12
Hyderabad meet up-sep12
 

Recently uploaded

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 

Recently uploaded (20)

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 

Hyd MuleSoft-Meetup-May 29,2021 | Migrating Mule 3 Java related code to Mule 4

  • 1. 29th March 2021 , 4pm IST Hyderabad MuleSoft Meetup MIGRATING MULE 3 JAVA RELATED CODE TO MULE 4
  • 2. Agenda •Community Details! •Introduction Of Organizers and Speakers •Important Announcements – Anypoint Studio New Release •Migrating Mule 3 Java Related Code to Mule 4 by Piyush Sharma •Queries •Trivia Quiz 2
  • 3. Community Details • Register for Meetups : https://meetups.mulesoft.com •Register for Official Training platform : https://training.mulesoft.com •MuleSoft forum : https://help.mulesoft.com •For all blogs : https://blogs.mulesoft.com/ •Anypoint platform : https://anypoint.mulesoft.com •Join Exam Readiness Sessions ! (Remind me to share at the end of the session) 3
  • 5. Speaker of the day! 5 • Working as an Integration developer with 5+ years’ of experience in different domains like retail, banking, consumer goods, healthcare etc and helping organizations in their digital transformation journey. • Started career with TIBCO and slowly moved to MuleSoft. • Happy to help and contribute to MuleSoft community and eventually learning new things in process. Love to travel and watch movies in free time. Reachable: https://www.linkedin.com/in/piyush3192/
  • 7. 2 New Anypoint Studio 7.9.0 • Anypoint Studio 7.9 enables users to use a dark theme, and upgrades its underlying infrastructure to Eclipse 4.18 and Java 11, adding official support for macOS Big Sur. • This version also introduces improvements for Dataweave code experience and enhanced macOS experience by notarizing Studio as a macOS application.
  • 9. By Piyush Sharma, Sr.Integration Developer at Billennium Mule 3 Java code Migration to Mule 4
  • 10. 10 Some Comparisons from Mule 3 to Mule 4
  • 11. 11 Some Comparisons from Mule 3 to Mule 4
  • 12. 12 Mule 3 Java Working
  • 13. 13 Mule 3 Java Working
  • 14. 14 Mule 4 Java Working Several ways of calling Java: • Calling Static Java Methods from DataWeave • Scripting Module (Ruby, Python,Groovy,JS) • Java Module
  • 15. 15 A look on Mule 3 Java Code 15 Mule API Packages Callable Interface Getting payload and flow variables Setting flow variables and return payload
  • 16. 16 16 Basic knowledge of Mule 3 Java class Mule API Package Imports: import org.mule.api.lifecycle.Callable; import org.mule.api.MuleEventContext; import org.mule.api.transport.PropertyScope; Class with callable interface: public class AddtwoNum implements Callable Oncall method @Override public Object onCall(MuleEventContext eventContext) throws Exception
  • 17. 17 17 Basic knowledge of Mule 3 Java class Read flow Variables according to their scope: myVar = eventContext.getMessage().getProperty(“name", PropertyScope.INVOCATION); Set flow Variables according to their scope: eventContext.getMessage().setProperty(“name", “Max”, PropertyScope.INVOCATION); Read payload: String payload = (String) eventContext.getMessage().getPayload(); Return payload: return eventContext.getMessage().getPayload();
  • 18. 18 18 Migrating Java functionality Mule 3 to Mule 4 Combined Approach: • Java classes cannot be simply migrated, requires manual efforts. • Utilize MMA tool along with custom changes. • Migrate most of the code and connector configuration using MMA. Identify and Address: • Identify Java classes which you really need to migrate. • Utilize Dataweave 2.0 at most of the places and scrap the old used java class for data transformation for improved performance and readability. • List down the java classes which have to be migrated.
  • 19. 19 19 Migrating Java functionality Mule 3 to Mule 4 Work with classes: • Once class finalized, start importing them. Please watch out for classes which import other classes as well. • Fix project structure and error, you might require to add dependency which are used in java class. • Sometimes you need to allow certain packages in studio which gets restricted. • After importing classes, there will be errors in classes as well, that’s where the manual efforts needs to be done.
  • 20. 20 20 Migrating Java functionality Mule 3 to Mule 4 Modify classes: • Remove all imports related to org.mule.api.*, as they are no longer supported in Mule 4. • Remove callable interface notation from class declaration(public class AddTwoNum implements Callable -> public class AddTwoNum ) • Modify onCall method , rename it and make it static. • Check for flow variables or properties which code reads, you now need to pass them as a parameters in static method. • Check for return type of method, if it doesn’t return anything it will be void, otherwise based on return datatype.
  • 21. Demo
  • 25. Enter Your Full Valid Name (no nick Names are allowed) Only those who have registered and joined the session will be allowed! Goto Mobile Browser Enter : kahoot.it
  • 26. Read the options and Tap the colour which has correct answer.