Thursday, June 21, 2018

Connect To The World With MuleSoft: A large-scale connectivity solution for enterprises

Introduction

With increasing trend of using cloud and creating solutions in the form of microservices, we are ending up with a large pool of small applications and services which are scattered across the globe. This has led to interoperability issues and service sprawl challenge where many applications include the code to connect to other application. What we need here to resolve this issue is an Enterprise Service Bus with the capability to connect to a wide spectrum of heterogeneous applications. This spectrum includes legacy applications running on premises to microservices hosted on the public cloud, from web applications using JMS to mobile apps. The choice of ESB is crucial to make sure that you need not carry the burden of writing adapters to connect to these systems on your shoulder. MuleSoft presents you with a vast variety of connectors, which is one of the biggest advantages of Mulesoft. Being open source and having a community, the number of connectors are increasing day by day. MuleSoft also provides DevKit, which helps you to create your own connectors to connect to your custom applications and tools.
In this paper, we will focus on the connectivity issues of applications and how MuleSoft is helping us to get through these challenges.

Importance of connectivity

In today’s age of information, cloud is playing crucial role of providing ease to the startup, mid-sized and large enterprises to quickly develop and make applications available to rest of the world. This had led to the creation of many small applications or services by different organizations including startups. Enterprise-grade packaged applications are getting replaced by multiple services offered independently by different players. Your enterprise data is now scattered in various systems like legacy systems, RDBMS, web application, files and No SQL databases and are hosted on different networks like LAN, in-premises data-centers, virtual networks, and clouds. While developing new applications or services, you will have to connect with these systems to fetch the required information.
Figure 1: Application Landscape (courtesy: Mulesoft training department)
This wide variety of approaches used in designing and hosting the application put forward a different challenge of connecting to these applications.

Interoperability Challenges in connecting to heterogeneous applications

Different applications/services you need to connect to, might be written using different languages, use different data formats, hosted on different platforms, and communicate using different protocols. Every application, which needs to connect to other application or service, needs to be aware of all technical details for communication. And when your IT landscape includes numerous such applications, it leads to service sprawl making it difficult to manage numerous point to point connections.
This problem gave birth to the concept of EAI (Enterprise Application Integration) where one single product, which is at the heart of your architecture, will connect your application to rest of the applications. The Connection from one application to another application gets routed through this EAI application. This broker can quickly become a bottleneck during heavy loads or can become a single point of failure. The concept is further evolved to something called as Service Bus but still uses a central routing component to pass messages from system to system. Whereas bus is divided into multiple components which can be distributed and scaled over the network.
Figure 2: Service Bus Architecture
Few of the known integration challenges are
·       Cloud Integration
·       ERP Integration
·       Mobile Application Integration

Anypoint Platform & Mule Runtime Engine

Anypoint Platform is a hybrid integration platform that enables organizations to easily build and rapidly scale an application network of apps, data, and devices through APIs and integrations. Mule, the runtime engine of Anypoint Platform, is a lightweight Java-based enterprise service bus (ESB) that allows developers to connect applications together quickly and easily, enabling them to exchange data.

MuleSoft Anypoint connectors

State of the art Mulesoft Anypoint Connectors facilitates the integration of Mule applications with third-party APIs and standard integration protocols. Anypoint studio has set of the built-in connectors including standard connectors like HTTP, email, file, FTP, JMS, and database. Other application specific connectors include Amazon, Jetty, MongoDB, SAP, and Salesforce. These connectors can directly be used in mule flow to connect to the internal and external systems. Anypoint exchange provides a home to never-ending list of connectors which can be quickly installed in studio and used to connect to the application. Entries in this list include different categories as CRMs, BPM tools, Cloud, Analytics tools, MOMs, ERPs, Social Media, RDBMS and NO-SQL databases, IoT tools, Collaboration tools etc. Listing some of the connectors here for reference.
CRM: Salesforce, Siebel, Microsoft Dynamics
Cloud: AWS, GCP, Azure
ERP: SAP, Oracle JD Edwards, Peoplesoft
RDBMS and NO-SQL: MySQL, Oracle, Amazon RDS, Mango DB, Cassandra
Collaboration: GitHub, JIRA, SharePoint, Google Tasks, Documentum, Yammer
Social Media: Facebook, LinkedIn, Twitter

Connector support categories

Anypoint connectors fall into one of the following categories according to their developer and support level available.
Community: MuleSoft or members of the MuleSoft community write and maintain these connectors. You don’t need any special account or license to use Community connector. Example: Twitter, Facebook, GitHub, JIRA
MuleSoft Certified: Developed by MuleSoft’s partners and developer community and are reviewed and certified by MuleSoft. Example: Splunk, Oracle JD Edward, Spark SQL, Pega, Hybris
Select: Maintained by Mulesoft, included in open source Mule distribution, can be used by everyone. However, support is only included in Anypoint Platform subscription. Example: LDAP, MongoDB, Amazon, Workday, Hadoop
Premium: MuleSoft maintains Premium connectors. You must have an active CloudHub Premium plan or an Enterprise subscription with an entitlement for the specific connector you wish to use. Example: SAP, Oracle Siebel, Google DFP, Peoplesoft

Creating custom connectors

An Anypoint connector is an extension module that eases the interaction between Mule application and external resources. These connectors hide the API complexity from integration developer. You can create your own connector to connect to your custom applications or tool developed within your organization. MuleSoft Anypoint DevKit enables the development of MuleSoft Anypoint Connectors. Mule connector has 2 operational sides.  Mule-facing side communicates with resource’s target-facing client side to enable content to travel between Mule applications and the external target-facing resource.


Figure 3: MuleConnector Architecture





Mule facing side of the connector consists of a Main Java Class with @Connector annotation. Configurable connector attributes are annotated with @Configurable annotation and functionality is annotated with @Processor attribute. Target facing side of a connector depends on client technology that enables access to the resource. This functionality consists of a class library and one or more classes that main classes use to access client functionality.

Connectors provided by Major ESBs

Though there are many solutions to this connectivity problem, all of them have their advantages and disadvantages. Let us discuss connectors provided by major players in the market.
Oracle ESB (OSB): provides JCA transport that interacts with back-end Enterprise Information Systems (EIS), letting these systems participate in the Service Bus integration environment. With JCA adapters, you can integrate proxy and business services with technologies like databases, file systems, FTP servers, messaging systems, email, LDAP, Coherence cache, cloud services, Salesforce, SAP and Oracle E-Business Suite. Oracle provides Transport SDK to develop custom transport provider.
Tibco: With TIBCO universal Connectors, you get one standardized drag and drop interface for all your on-premises applications and cloud services in one place. Apart from the standard connectors like http, email, database, JMS, ftp and file, TIBCO provide connectors for Salesforce, Facebook, SAP, Amazon, NetSuite and many more. TIBCO Connectors Software Development Kit helps IT organizations build connectors for custom or specialized applications.
IBM Websphere ESB: WebSphere Adapters provide a service-oriented approach to integration with EIS. WebSphere Adapters are compliant with JCA 1.5. WebSphere include adapters for email, flat files, FTP, JDBC, JD Edwards EnterpriseOne, Oracle E-Business Suite, Siebel Business Applications, and SAP Software. You can contribute own external service or data wizard plug-in customized to suit to your organization

Contribution from Mulesoft’s Community

MuleSoft has a community where members are actively involved in creating and testing the connectors. With contribution from more than 13,000 members, count of connectors developed by MuleSoft community is increasing rapidly. As of today, we have more than 65 connectors from the community. Some of the connectors to mention are Twitter, Dropbox, Facebook, Google Calendar, Google Contacts, GitHub, JIRA, LinkedIn, Yammer, Drupal, Paypal, Expedia and so on.

Easy connectivity with the specialized connector

All ESB implementations (OSB, Tibco, IBM Websphere and …) provides connectivity to different systems using most of the standard protocols. Whereas, Mulesoft provides more than 180 connectors to connect to various systems. Most of these connectors are specialized connectors to connect to underlying systems through their exposed APIs. This result in easy connectivity to those systems, less learning curve and saves the development time for Mule applications.
To put up my point, let me take you through the example of connecting to Salesforce. You can connect to Salesforce using their exposed API as most of the ESBs will do, or use salesforce connector available in Mulesoft. Let’s discuss both the approaches.
Connecting to Salesforce through API:
Salesforce has exposed their functionality with the set of APIs categorized as REST API, SOAP API, Streaming API and Bulk API. This Salesforce API landscape is as vast as the ocean. Once you could find the appropriate API and operation you need to invoke, you need to learn about how to send the authentication token, what are data formats (JSON, XML, CSV, and Custom) and which communication style (synchronous and asynchronous) to use. Next step will be to configure ‘HTTP’ or ‘Web Service Consumer’ component in your flow with required data transformations before and after. Every time you need to call an operation, you must specify the name of the operation, the method to be used (get/ post/ put …), name and type of parameters (query, URI, form …). Please refer https://trailhead.salesforce.com/en/modules/api_basics/units/api_basics_overview for further information.
Connecting to Salesforce through connector:
To connect to Salesforce through a connector, add salesforce component in your flow. Configure the connector with security information like username, password, and security token. Select appropriate operation, provide data required to execute the operation, and you are done with the configuration. The following picture shows one example of a query operation.
Figure 4: Salesforce Connector Configuration



Summary

With a set of out-of-the-box Anypoint connectors, you can connect to any application hosted on-premises, in data centers or on the cloud. Instead of focusing on building the adapters before you could build your integration solution, with MuleSoft you can start building your integration solution with no time. Making use of these inbuilt connectors, you are set free to concentrate on your integration solution and improving your deliverable's quality and achieving your business goals much faster.