Hi friends, Mulesoft is an awesome integration tool and it is also in huge demand these days. It can also be used by civil engineers. It can also be very useful for creating an Internet of Things. Mulesoft flows works from components knowns as Connector. This is the first article in the series of six article. This series will consist of video demonstrating each article as well as a presentation for better understanding. In this article, I will show How we can start making Mule Custom Connector.
Why Mule Custom Connector?
Mulesoft works with the help of certain connectors. A combination of these Mule connectors creates a Mule flow. There are so many connectors already provided out of the box by mulesoft. Then there is the mulesoft exchange where you can look for connectors install them and use them in your flows. But Still, there can be a number of services which are exposed by some SOAP and REST but for most of the services, all the functionalities will be available in form of SDKs. and Mulesoft may not be able to provide a connector for each one of them. There can also be the case that there is some feature in SDK but Mule connector is unable to do that. In all such cases, one can create a Mule Custom Connector and get benefits from it.
Prerequisites to start making Mule Custom Connector.
1st step is to install the DevKit. In order to do so, You need to go to Help menu and then click on Install New Software. This will open a new window in which from the drop down menu. You will choose Anypoint DevKit update site option. Then Select both plugin and extension and Click on Next. Once the installation is done you will have to restart anypoint studio.
This process is shown in the images below:
In order to install maven, you first need to download the Zip from official Maven site. Click HERE for official maven site. Extract the maven zip. Preferably in the C Drive.
In anypoint Studio, Go To Windows menu click on preferences and find maven. Click on maven and Click Browse to give the path to the extracted maven folder. After that, you can click on Test Maven configuration button to see if everything is in place or not. Click Okay.
Still in Doubt? Refer to the Image below.
First, download and install JDK in your system. Then to install JDK for anypoint studio go to Window menu and click on Preferences. In preferences window select Java, then Installed JREs. If JDK is already there Choose it and Click okay. This will set up the JDK for your anypoint studio. If you can’t see JDK in your installed JREs list in mulesoft you need to add it and to do so add it as shown in the image below and view the presentation for more details.
Start making Mule Custom Connector
Now you are all set to start making you own mule custom connector and customizing the existing ones. Now in order to start, you will need to create a new project. To create a new project click on File and then Choose New. In the list appearing up you need to choose Anypoint Connector Project. This will open a new window where you are supposed to enter the details about the connector you want to build.
The first thing you need to mention is whether you want the connector to be SDK based in which you can use SDK, SOAP as well REST service. You can choose the 2nd option if you want your connector to be SOAP based. There you can specify one or more WSDL to get the connector created. SDK is what you will be choosing in most of the cases. So I am explaining the same below.
Specifying connector you want to customize
Clicking on Next will take you the portion where you need to specify the features of your connector. Connector Name – It must follow the convention. If it is not following the convention Mule will not allow you to proceed ahead. Then you can specify if you want to use custom location, namespace or project name. You can also keep them as default.In Generation Settings portion you can specify
In Generation Settings portion you can specify whether you want your connector to be SDK, SOAP or REST services based. However, inside the connector, you can use whatever you want this portion just changes the way default classes are created. Below that you can specify whether you want to add authorization to your connector or not. Below that specify features you want to use like DataSense, Pagination etc. Then Click Next to Proceed
In next screen, you will be able to specify Maven setting. You can also mention GitHub link if you want to use git. Then click on Next and specify the Label, Logo, and Background of the connector.
You can see all these steps in the image given below:
Before you start making you own connector please go throu the following preasentation as well as video. This will give more better understanding of the process and allows you to get the anypoint studio setup done even more faster.
If you like this work. Like it share and comment in the section down below. If you want me to create another tutorial and need any help regarding mulesoft. just let me know in the comments section or message me anywhere.