20th Feb 2021
Kolkata MuleSoft Meetup #6
Custom Connector using Java and
XML SDK in MuleSoft
2
Guidelines for our Virtual Meetup
1. Please keep yourself on mute unless you have any query/question
2. You can write down your questions in the chat during the session.
3. Once we are done with the day, don’t forget to provide your
valuable feedback.
3
●About the organizers:
○ Jiten Chawla
○ Brojeswar Roy
○ Roikka Hazarika
Introductions
A SHOW OF HANDS:
Who is new to this Meetup?
Speaker
4
Technical Expertise:
➢ 10+ years of Technical Experience.
➢ 5+ years of Experience in the Integration Domain.
➢ Certified Mulesoft Developer - Level 1.
➢ Certified Integration Developer in Dell Boomi.
➢ Member, Alumni Association IIT Bombay.
➢ Mule Meetup Speaker.
Linkedin Profile for more details: https://www.linkedin.com/in/ashishpardhi/
● What is Connector?
● What is Mule 4 SDK?
○ JAVA SDK
○ XML SDK
● Differences with Mule 3 Devkit
● Module Structure
● Best Practices
● References for existing Connectors
● Implementation Overview
○ Live Demo
Agenda
5
● Bring target system in Mule Runtime.
● Mechanism to extend Mule 4 Runtime by creating new modules.
● Mulesoft has a range of inbuilt connector.
○ SFTP, FTP, JDBC etc
○ SAAS systems like Salesforce
○ Google and AWS services, and many more.
● Modules with custom functionality, such as the Validations Module.
● Mechanism types
○ Java Mule SDK : advanced, feature-rich
○ XML SDK : provides only outbound operations and doesn’t support recursive calls
What is Connector?
6
● The Mule SDK allows Mule developers to create modules
that can be used just like any other module in Mule (e.g.,
HTTP module, Java module, Validation module).
● Modules enable reuse, offload complexity and deliver
consistent behavior.
● Mule Extensions API
○ This API is a well-defined contract for how modules can
interact with the Mule Runtime.
What is the Mule SDK?
7
● DevKit is not available for Mule 4.
● The SDK is not a code generator. The built module does not contain any generated
code (not even the XSD schema).
● Compared to DevKit, the SDK is more powerful and supports more features:
○ Transactions
○ Request-response message sources
○ Dynamic configurations
○ Routers
○ Non-blocking operations
○ Classloading isolation
○ Enhanced interoperability with runtime services
Mule4 SDK vs Mule3 Devkit
8
Mule 4 Java SDK Module Structure
9
Mule 4 XML SDK Module Structure
10
• It should be generic - No Business specific use-case
• It should be thread safe
• No rely on flow variables(independent of flow)
• No dependency on Message attributes
• Mule context should not be accessed
• Don’t use system variable/annotation names(Mule skip them)
• Add Data Sense support(Optional but most recommended)
Best Practices
11
• Few out of many but they are complex to understand[By Mulesoft]
– https://github.com/mulesoft/mule-http-connector
– https://github.com/mulesoft/mule-email-connector
• Few simple to understand[Not by Mulesoft]
– https://github.com/mule-org-uk/docu-connector
– https://github.com/mulesoft-consulting/json-logger
– https://github.com/stackmerge/CurrencyConverterExtension
References to existing connectors
12
Demo
Q&A
Thank you
16
Get Ready for the Trivia
Trivia Quiz
17
● Share:
○ Tweet using the hashtag #MuleSoftMeetups
○ Invite your network to join: https://meetups.mulesoft.com/kolkata/
● Feedback:
○ Fill out the survey feedback and suggest topics for upcoming events
○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program
What’s next?
Thank you

Custom Connector using Java and XML SDK in MuleSoft | Kolkata MuleSoft Meetup #6

  • 1.
    20th Feb 2021 KolkataMuleSoft Meetup #6 Custom Connector using Java and XML SDK in MuleSoft
  • 2.
    2 Guidelines for ourVirtual Meetup 1. Please keep yourself on mute unless you have any query/question 2. You can write down your questions in the chat during the session. 3. Once we are done with the day, don’t forget to provide your valuable feedback.
  • 3.
    3 ●About the organizers: ○Jiten Chawla ○ Brojeswar Roy ○ Roikka Hazarika Introductions A SHOW OF HANDS: Who is new to this Meetup?
  • 4.
    Speaker 4 Technical Expertise: ➢ 10+years of Technical Experience. ➢ 5+ years of Experience in the Integration Domain. ➢ Certified Mulesoft Developer - Level 1. ➢ Certified Integration Developer in Dell Boomi. ➢ Member, Alumni Association IIT Bombay. ➢ Mule Meetup Speaker. Linkedin Profile for more details: https://www.linkedin.com/in/ashishpardhi/
  • 5.
    ● What isConnector? ● What is Mule 4 SDK? ○ JAVA SDK ○ XML SDK ● Differences with Mule 3 Devkit ● Module Structure ● Best Practices ● References for existing Connectors ● Implementation Overview ○ Live Demo Agenda 5
  • 6.
    ● Bring targetsystem in Mule Runtime. ● Mechanism to extend Mule 4 Runtime by creating new modules. ● Mulesoft has a range of inbuilt connector. ○ SFTP, FTP, JDBC etc ○ SAAS systems like Salesforce ○ Google and AWS services, and many more. ● Modules with custom functionality, such as the Validations Module. ● Mechanism types ○ Java Mule SDK : advanced, feature-rich ○ XML SDK : provides only outbound operations and doesn’t support recursive calls What is Connector? 6
  • 7.
    ● The MuleSDK allows Mule developers to create modules that can be used just like any other module in Mule (e.g., HTTP module, Java module, Validation module). ● Modules enable reuse, offload complexity and deliver consistent behavior. ● Mule Extensions API ○ This API is a well-defined contract for how modules can interact with the Mule Runtime. What is the Mule SDK? 7
  • 8.
    ● DevKit isnot available for Mule 4. ● The SDK is not a code generator. The built module does not contain any generated code (not even the XSD schema). ● Compared to DevKit, the SDK is more powerful and supports more features: ○ Transactions ○ Request-response message sources ○ Dynamic configurations ○ Routers ○ Non-blocking operations ○ Classloading isolation ○ Enhanced interoperability with runtime services Mule4 SDK vs Mule3 Devkit 8
  • 9.
    Mule 4 JavaSDK Module Structure 9
  • 10.
    Mule 4 XMLSDK Module Structure 10
  • 11.
    • It shouldbe generic - No Business specific use-case • It should be thread safe • No rely on flow variables(independent of flow) • No dependency on Message attributes • Mule context should not be accessed • Don’t use system variable/annotation names(Mule skip them) • Add Data Sense support(Optional but most recommended) Best Practices 11
  • 12.
    • Few outof many but they are complex to understand[By Mulesoft] – https://github.com/mulesoft/mule-http-connector – https://github.com/mulesoft/mule-email-connector • Few simple to understand[Not by Mulesoft] – https://github.com/mule-org-uk/docu-connector – https://github.com/mulesoft-consulting/json-logger – https://github.com/stackmerge/CurrencyConverterExtension References to existing connectors 12
  • 13.
  • 14.
  • 15.
  • 16.
    16 Get Ready forthe Trivia Trivia Quiz
  • 17.
    17 ● Share: ○ Tweetusing the hashtag #MuleSoftMeetups ○ Invite your network to join: https://meetups.mulesoft.com/kolkata/ ● Feedback: ○ Fill out the survey feedback and suggest topics for upcoming events ○ Contact MuleSoft at meetups@mulesoft.com for ways to improve the program What’s next?
  • 18.