Mule connectors are extensions that integrate third party systems and APIs with Mule applications. To develop a custom connector, you need to install Java JDK, Maven, Anypoint Studio, and the connector plugin. You determine the resource access method, choose an authentication mechanism, data model, add annotations, code tests, and document the connector. Finally, you package the connector for distribution through licensing, walkthroughs, and compression.
2. Overview
ï¶ What is Mule Connector?
ï¶ Development Steps
ï¶ Setup to create Connector
ï¶ Determine resource access
ï¶ Choose an authentication mechanism
ï¶ Choose the connectorâs data model
ï¶ Add connector @ attribute annotations
ï¶ Code tests
ï¶ Document your connector
3. What is Mule Connector?
A MuleSoft connector is an extension module to the MuleSoft Anypoint Platform, with
modules that ease the interconnection of third-party systems and APIs with Mule
applications.
4. Development Steps
Step 1:
To develop a custom connector one need to install:
Java JDK version 7,
Apache Maven,
Anypoint Studio, and
Anypoint DevKit Plugin to build and test your connector.
You can develop a connector using Windows, Mac, or Linux.
5. Setup to create Connector
New Connector :
âąCreate an Anypoint project -
âąSet up Anypoint Studio and install the connector plugin.
Existing Connector:
âąClick File > Import > Anypoint Studio > Anypoint Connector Project from External
Location, choose a URL or a .zip file, and complete the wizard to locate and import the
project.
6. Determine resource access
Determine resource access - Each resource has a different access method, such as
REST,
SOAP,
FTP, or
the Java SDK features.
7. Choose an authentication
mechanism
Choose an authentication mechanism -
Mule supports OAuth V1 or V2, and username and password authentication (known
as connection management), which can be used for protocols such as API Key, SAML,
NTLM, Kerberos, or LDAP.
8. Choose the connectorâs data model
Choose the connectorâs data model - Models can be static Java objects or dynamic
objects.
You can use
DataSense - Determine what information the target resource expects.
9. Add connector @ attribute
annotations
Add connector @ attribute annotations -
Create code for your connector containing the @ attributes that Mule uses to designate
the important parts of your connector.
10. Code tests
Code tests - Tests can be unit tests, functional tests, and Studio interoperability tests.
While DevKit does not enforce writing tests, you should develop unit and functional tests
for your connector as part of the development process. A connector should not be
considered production-ready without a proper test suite.
11. Document your connector
Document your connector -
MuleSoft provides a template that helps you fill in the blanks to create documentation
to help your staff and to help others understand the features and use of your
connector.
12. Package your connector
Package your connector
When your connector is ready for release to a broad audience, take the following
additional steps to ensure user success:
âą Create a license agreement for your connector.
âą Develop end-to-end walkthroughs to illustrate performing common use cases with
your connector.
âą Create a compressed file for distribution.
13. Conclusion
MuleSoftâs program certifies and publishes third party connectors to be distributed
through Anypoint Exchange.
References:
https://docs.mulesoft.com/anypoint-connector-devkit/v/3.8/