Creating a custom connector in mule

Preview:

Citation preview

Creating a Custom Connector in Mule

By

Achyuta Laxmi

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

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.

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.

Determine resource access

Determine resource access - Each resource has a different access method, such as REST, SOAP, FTP, or the Java SDK features.

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.

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.

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.

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.

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.

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.

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.7/

Thank you

Recommended