SlideShare a Scribd company logo
All contents © MuleSoft, LLC
December 2020
Chris Hughes, Strategic Advisor at MuleSoft
Using the Mule 4 SDK
to build a Connector
All contents © MuleSoft, LLC
Agenda
1. Introduction
a. What is a Connector?
b. Mule 4 SDK for Java vs. Mule 3 DevKit
c. Best Practices
2. Mule 4 SDK Object Model
3. How to build your own Extension
4. docu-connector Code Walkthrough
5. docu-connector Demonstration
2
All contents © MuleSoft, LLC
Introduction: What is a Connector?
Mule 4 provides a well-defined mechanism to extend the runtime, by creating “modules” that
you can easily add to Mule applications.
Examples of modules include:
● Connectors, such as HTTP
● Modules, such as the Validations module
3
All contents © MuleSoft, LLC
Introduction: Mule 4 SDK vs. Mule 3 DevKit
● Mule 4 SDK replaces DevKit
● DevKit is not available for Mule 4
● Mule 4 provides XML and Java SDKs
● Mule 4 SDK makes use of Java Annotations, but is not a code generator
● Mule 4 SDK is more flexible than DevKit and supports:
○ Transactions
○ Request-Response message sources
○ Dynamic configurations
○ Routers
○ Non-blocking operations
○ Classloading isolation
4
All contents © MuleSoft, LLC
Introduction: Best Practices
General Rules:
● A connector’s purpose is to bring the target system into the Mule language
● A connector should not include operations that implement specific business use cases
● Coding Rules
○ Design for Thread Safety
○ Never Access Flow Variables
○ Never Use Message Attributes as Parameters
○ Don’t Access the MuleContext
5
All contents © MuleSoft, LLC
Mule 4 SDK Object Model
6
All contents © MuleSoft, LLC
Mule 4 SDK Object Model
Core Elements of the SDK Object Model are:
● Component
○ Given a set of parameters, a component encapsulates functionality that can be executed to
produce or alter messages in a flow
● Configuration
○ A set of parameters that affect the behaviour of the module
○ Sources and Operations may depend on a Configuration for parameters
● Connection Provider
○ Handles management of connections created from a Configuration
○ Configurations may have none, one, or many Connection Providers
● Parameter
○ A value placeholder whose context can be defined within all of the above
7
All contents © MuleSoft, LLC
How to build your own Extension
● https://docs.mulesoft.com/mule-sdk/1.1/getting-started
● Remember: a connector should be a generic extension to the Mule runtime (not specific
to a business use case)
● Consider how the target system aligns with the Mule SDK Object Model:
○ Just because the SDK provides a ConnectionProvider annotation doesn’t mean your extension
has to make use of one!
● There are some good advanced examples on GitHub, but avoid unnecessary complexity:
○ https://github.com/mulesoft/mule-email-connector
○ https://github.com/mulesoft/mule-http-connector
● Or, you could take a look at my simple DocuSign connector:
○ https://github.com/mule-org-uk/docu-connector
8
All contents © MuleSoft, LLC
Why build a DocuSign Connector?
● DocuSign already exposes a REST API
● DocuSign Authentication process is:
○ JWT-based, but
○ Requires the definition, review, and promotion of an “integrator key”
○ Relies on algorithm that would be difficult (if not impossible) to implement in DataWeave
○ Easily reusable, if defined appropriately
○ https://developers.docusign.com/platform/auth/jwt/jwt-get-token/
9
All contents © MuleSoft, LLC
Time to look at some code!
docu-connector Code Walkthrough
10
All contents © MuleSoft, LLC
Let’s see it in action!
docu-connector Demonstration
11
All contents © MuleSoft, LLC
Thank you!

More Related Content

PDF
MuleSoft: How to Engage Partners/Customers and API Led with Alexa
PDF
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
PDF
Metadata definition between flows on Studio 7 : MuleSoft Virtual Muleys Meetups
PDF
MuleSoft MUnit Test Recorder Meetup
PDF
Melbourne Virtual MuleSoft Meetup October 2021
PPTX
Demystifying the use of circuit breakers with MuleSoft
PDF
Sydney MuleSoft Meetup #16 - 19 November 2020
PDF
MuleSoft Composer - 09122021 - Virtual Muleys
MuleSoft: How to Engage Partners/Customers and API Led with Alexa
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
Metadata definition between flows on Studio 7 : MuleSoft Virtual Muleys Meetups
MuleSoft MUnit Test Recorder Meetup
Melbourne Virtual MuleSoft Meetup October 2021
Demystifying the use of circuit breakers with MuleSoft
Sydney MuleSoft Meetup #16 - 19 November 2020
MuleSoft Composer - 09122021 - Virtual Muleys

What's hot (20)

PPTX
microservices in mulesoft
PDF
MuleSoft Meetup Singapore - Reliable Messaging & RTF Operations
PPTX
Richmond MuleSoft Meetup 2021-08-18
PDF
MuleSoft Meetup Singapore June 2021
PPTX
Meetup bangalore-sept5th 2020 (1)
PPTX
Chicago rtf meetup august 17 2021
PPTX
Mule soft meetup_-_finland_september_25th__2020 v2.0
PPTX
Jaipur MuleSoft Meetup Group - Virtual Meetup #5
PPTX
MuleSoft Meetup Bangalore - March 6 2021
PDF
Melbourne Virtual MuleSoft Meetup November 2020
PDF
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
PPTX
MuleSoft Meetup Houston #15
PPTX
MuleSoft Meetup Adelaide 7th April 2021
PPTX
Mulesoft Solutions for SOA
PPTX
Vancouver mulesoft meetup_23-july
PPTX
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
PPTX
Mule soft meetup__adelaide_october_2020_final (2)
PDF
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
PDF
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
PPTX
MuleSoft Summer Meetup - Germany - 09 Jun 2021
microservices in mulesoft
MuleSoft Meetup Singapore - Reliable Messaging & RTF Operations
Richmond MuleSoft Meetup 2021-08-18
MuleSoft Meetup Singapore June 2021
Meetup bangalore-sept5th 2020 (1)
Chicago rtf meetup august 17 2021
Mule soft meetup_-_finland_september_25th__2020 v2.0
Jaipur MuleSoft Meetup Group - Virtual Meetup #5
MuleSoft Meetup Bangalore - March 6 2021
Melbourne Virtual MuleSoft Meetup November 2020
Sustainability Challenge, Postman, Rest sheet and Anypoint provider : MuleSof...
MuleSoft Meetup Houston #15
MuleSoft Meetup Adelaide 7th April 2021
Mulesoft Solutions for SOA
Vancouver mulesoft meetup_23-july
Designing Apps for Runtime Fabric: Logging, Monitoring & Object Store Persist...
Mule soft meetup__adelaide_october_2020_final (2)
Containerising the Mule Runtime with Kubernetes & From Zero to Batch : MuleS...
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
MuleSoft Summer Meetup - Germany - 09 Jun 2021
Ad

Similar to Using the Mule 4 SDK to build a connector : MuleSoft Virtual Muleys Meetups (20)

PPTX
Custom Connector using Java and XML SDK in MuleSoft | Kolkata MuleSoft Meetup #6
PPTX
Mulesoft Meetup Bangalore - 6th March 2021
PPTX
Building Custom Connectors Using XML SDK in Mule 4
PPTX
Introduction to CloudHub 2.0
PPTX
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
PPTX
Discover Salesforce Commerce Cloud and Vlocity Integration Patterns
PPTX
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
PDF
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
PPTX
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
PPTX
Custom MuleSoft connector using Java SDK
PPTX
MuleSoft Meetup Charlotte 2 - 2019
PPTX
Cracow MuleSoft Meetup #1
PPTX
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
PPTX
Custom Connector development using Mule SDK
PPTX
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
PPT
Anypoint connector dev kit
PDF
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
PDF
Melbourne Virtual MuleSoft Meetup December 2022
PPT
Mule anypoint connector
PPT
Mule tcat server
Custom Connector using Java and XML SDK in MuleSoft | Kolkata MuleSoft Meetup #6
Mulesoft Meetup Bangalore - 6th March 2021
Building Custom Connectors Using XML SDK in Mule 4
Introduction to CloudHub 2.0
Ahmadabad mule soft_meetup_20_february_2021_muleconnectordevelopment
Discover Salesforce Commerce Cloud and Vlocity Integration Patterns
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Custom MuleSoft connector using Java SDK
MuleSoft Meetup Charlotte 2 - 2019
Cracow MuleSoft Meetup #1
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Custom Connector development using Mule SDK
How to Expand Anypoint Platform's Capabilities by Developing Custom Connectors
Anypoint connector dev kit
MuleSoft Surat Virtual Meetup#15 - Caching Scope, Caching Strategy and Jenkin...
Melbourne Virtual MuleSoft Meetup December 2022
Mule anypoint connector
Mule tcat server
Ad

More from Angel Alberici (8)

PDF
MuleSoft Sizing Guidelines - VirtualMuleys
PDF
20220324 - Angel Updates - PKO
PDF
MuleSoft PKO - C4E and Platform Insights
PDF
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
PDF
Mule 4 migration + Common Integration Challenges : MuleSoft Virtual Muleys Me...
PDF
20210428 - Sustainable Engineering practices & API Communities: Adoption Best...
PDF
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
PDF
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups
MuleSoft Sizing Guidelines - VirtualMuleys
20220324 - Angel Updates - PKO
MuleSoft PKO - C4E and Platform Insights
MuleSoft Event Driven Architecture (EDA Patterns in MuleSoft) - VirtualMuleys63
Mule 4 migration + Common Integration Challenges : MuleSoft Virtual Muleys Me...
20210428 - Sustainable Engineering practices & API Communities: Adoption Best...
Operationalizing your C4E VirtualMuleys & Deployment Considerations: Cloudhub...
MuleSoft Runtime Fabric (RTF): Foundations : MuleSoft Virtual Muleys Meetups

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation theory and applications.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Modernizing your data center with Dell and AMD
PDF
Empathic Computing: Creating Shared Understanding
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation theory and applications.pdf
Encapsulation_ Review paper, used for researhc scholars
Modernizing your data center with Dell and AMD
Empathic Computing: Creating Shared Understanding
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

Using the Mule 4 SDK to build a connector : MuleSoft Virtual Muleys Meetups

  • 1. All contents © MuleSoft, LLC December 2020 Chris Hughes, Strategic Advisor at MuleSoft Using the Mule 4 SDK to build a Connector
  • 2. All contents © MuleSoft, LLC Agenda 1. Introduction a. What is a Connector? b. Mule 4 SDK for Java vs. Mule 3 DevKit c. Best Practices 2. Mule 4 SDK Object Model 3. How to build your own Extension 4. docu-connector Code Walkthrough 5. docu-connector Demonstration 2
  • 3. All contents © MuleSoft, LLC Introduction: What is a Connector? Mule 4 provides a well-defined mechanism to extend the runtime, by creating “modules” that you can easily add to Mule applications. Examples of modules include: ● Connectors, such as HTTP ● Modules, such as the Validations module 3
  • 4. All contents © MuleSoft, LLC Introduction: Mule 4 SDK vs. Mule 3 DevKit ● Mule 4 SDK replaces DevKit ● DevKit is not available for Mule 4 ● Mule 4 provides XML and Java SDKs ● Mule 4 SDK makes use of Java Annotations, but is not a code generator ● Mule 4 SDK is more flexible than DevKit and supports: ○ Transactions ○ Request-Response message sources ○ Dynamic configurations ○ Routers ○ Non-blocking operations ○ Classloading isolation 4
  • 5. All contents © MuleSoft, LLC Introduction: Best Practices General Rules: ● A connector’s purpose is to bring the target system into the Mule language ● A connector should not include operations that implement specific business use cases ● Coding Rules ○ Design for Thread Safety ○ Never Access Flow Variables ○ Never Use Message Attributes as Parameters ○ Don’t Access the MuleContext 5
  • 6. All contents © MuleSoft, LLC Mule 4 SDK Object Model 6
  • 7. All contents © MuleSoft, LLC Mule 4 SDK Object Model Core Elements of the SDK Object Model are: ● Component ○ Given a set of parameters, a component encapsulates functionality that can be executed to produce or alter messages in a flow ● Configuration ○ A set of parameters that affect the behaviour of the module ○ Sources and Operations may depend on a Configuration for parameters ● Connection Provider ○ Handles management of connections created from a Configuration ○ Configurations may have none, one, or many Connection Providers ● Parameter ○ A value placeholder whose context can be defined within all of the above 7
  • 8. All contents © MuleSoft, LLC How to build your own Extension ● https://docs.mulesoft.com/mule-sdk/1.1/getting-started ● Remember: a connector should be a generic extension to the Mule runtime (not specific to a business use case) ● Consider how the target system aligns with the Mule SDK Object Model: ○ Just because the SDK provides a ConnectionProvider annotation doesn’t mean your extension has to make use of one! ● There are some good advanced examples on GitHub, but avoid unnecessary complexity: ○ https://github.com/mulesoft/mule-email-connector ○ https://github.com/mulesoft/mule-http-connector ● Or, you could take a look at my simple DocuSign connector: ○ https://github.com/mule-org-uk/docu-connector 8
  • 9. All contents © MuleSoft, LLC Why build a DocuSign Connector? ● DocuSign already exposes a REST API ● DocuSign Authentication process is: ○ JWT-based, but ○ Requires the definition, review, and promotion of an “integrator key” ○ Relies on algorithm that would be difficult (if not impossible) to implement in DataWeave ○ Easily reusable, if defined appropriately ○ https://developers.docusign.com/platform/auth/jwt/jwt-get-token/ 9
  • 10. All contents © MuleSoft, LLC Time to look at some code! docu-connector Code Walkthrough 10
  • 11. All contents © MuleSoft, LLC Let’s see it in action! docu-connector Demonstration 11
  • 12. All contents © MuleSoft, LLC Thank you!