SlideShare a Scribd company logo
1 of 27
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 2NitushreeJena
 
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__finalSubhash 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_handlingManish Kumar Yadav
 
Meet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalMeet up slides_mumbai_05022020_final
Meet up slides_mumbai_05022020_finalAkshata Sawant
 
MuleSoft Meetup Warsaw Group #1
MuleSoft  Meetup Warsaw Group #1MuleSoft  Meetup Warsaw Group #1
MuleSoft Meetup Warsaw Group #1Patryk 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 2019Ieva 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_errorhanlingandmonitoringalertsShekh 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 exampleRoyston 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 CONNECTSabrina 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 DemoManjuKumara 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__2020D.Rajesh Kumar
 
MuleSoft CloudHub API Versioning
MuleSoft CloudHub API VersioningMuleSoft CloudHub API Versioning
MuleSoft CloudHub API VersioningPatryk Bandurski
 
Error Handling in Mulesoft
Error Handling in MulesoftError Handling in Mulesoft
Error Handling in MulesoftAmit 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.xSantosh Ojha
 
MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019MuleSoft Meetup Charlotte 2 - 2019
MuleSoft Meetup Charlotte 2 - 2019Subhash Patel
 
Mule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XMule Testing in Mulesfoft 4.X
Mule Testing in Mulesfoft 4.XAmit Singh
 
Custom transformer and annotation
Custom transformer and annotationCustom transformer and annotation
Custom transformer and annotationSunil 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 AutomationStephen Fuqua
 
Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018Manila MuleSoft Meetup - September 2018
Manila MuleSoft Meetup - September 2018Ryan Anthony Andal
 
MuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesMuleSoft Meetup 3 Charlotte Presentation Slides
MuleSoft Meetup 3 Charlotte Presentation SlidesSubhash Patel
 
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, 2019Patryk Bandurski
 
Java modulesystem
Java modulesystemJava modulesystem
Java modulesystemMarc Kassis
 
Mulesoft Meetup Bangalore - 6th March 2021
Mulesoft Meetup Bangalore -  6th March 2021Mulesoft Meetup Bangalore -  6th March 2021
Mulesoft Meetup Bangalore - 6th March 2021Gaurav 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
 
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 ConnectorsAaronLieberman5
 
Custom Connector development using Mule SDK
Custom Connector development using Mule SDKCustom Connector development using Mule SDK
Custom Connector development using Mule SDKNavin Kare
 
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
 
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
 
Custom Connector development using Mule SDK
Custom Connector development using Mule SDKCustom Connector development using Mule SDK
Custom Connector development using Mule SDK
 
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-MonitoringSravan Lingam
 
MuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptxMuleSoft RPA for Beginners.pptx
MuleSoft RPA for Beginners.pptxSravan 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.pptxSravan Lingam
 
Toronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptxToronto Event Sourcing using Mulesoft.pptx
Toronto Event Sourcing using Mulesoft.pptxSravan Lingam
 
Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022Hyderabad mule meetup_march_2022
Hyderabad mule meetup_march_2022Sravan 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-sep12Sravan 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

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

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.