Custom Validation in Mule 4 Using Mule SDK

Custom Validation in Mule

Validators are operations that validate the Mule Message without changing the message. Validators can produce these effects:

  • If the condition the validator demands is fulfilled, the flow continues, and the Mule Message remains the same.
  • If the condition the validator demands is not fulfilled, an error is thrown.

Today we will be creating a custom validation that will validate whether a currency is valid or not. 

Anypoint CLI Commands in MuleSoft

Introduction

Anypoint CLI is a scripting and command-line tool for both Anypoint Platform and Anypoint Platform PCE. We will be using Anypoint CLI commands for Anypoint Platform accounts, API Manager, CloudHub applications, design center projects, and exchange assets.

Prerequisites

Installation

  • Verify the npm version with the command npm -version
  • Anypoint CLI installation npm install -g anypoint-cli@latest

Authentication

You can configure Anypoint CLI authentication with username and password, client ID and client secret, or a bearer token. At least one method is required.

Mule Application Deployment to Cloudhub Using Connected App

In this article, we will create a Mule application and deploy the same to the cloud hub using Connected App. 

Connected APP

The Connected Apps feature provides a framework that enables an external application to integrate with the Anypoint Platform using APIs through OAuth 2.0 and OpenID Connect. Connected apps help users delegate their access without sharing sensitive credentials or giving complete control of their accounts to third parties. Actions taken by connected apps are audited, and users can also revoke access. Note that some products do not currently include client IDs of the Connected Apps features. The Connected Apps feature enables you to use secure authentication protocols and control an app’s access to user data. Additionally, end-users can authorize the app to access their Anypoint Platform data.