DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Source-Driven Development in Salesforce: Managing Metadata and API Versions
  • How to Introduce a New API Quickly Using Micronaut
  • Building a Real-Time Audio Transcription System With OpenAI’s Realtime API
  • Efficient API Communication With Spring WebClient

Trending

  • Designing for Sustainability: The Rise of Green Software
  • Navigating Double and Triple Extortion Tactics
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Comparing Managed Postgres Options on The Azure Marketplace
  1. DZone
  2. Data Engineering
  3. Databases
  4. Using API instance in Anypoint Platform 2

Using API instance in Anypoint Platform 2

In this article, I am going to explain the main purpose of API instance and its use in the Anypoint Platform.

By 
Anupam Gogoi user avatar
Anupam Gogoi
·
Jul. 02, 18 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
7.4K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

In this article, I am going to explain the main purpose of API instance and its use in the Anypoint Platform. This is a follow-up article of the previous one. 

What is API Instance?

Imagine the Java class paradigm. Multiple objects can be created from a single Java class. Approximately the same principle applies to this API instance concept. Let's suppose that our API (The RAML specs that we created in Design Center and published in the Exchange as an asset) is the Java class. Now we can create multiple instances from the API in multiple environments.  Just imagine something as shown below to get an idea.

Image title


What's the Use of it?

You can create various instances of the same API and apply different policies to them separately. Please check the documentation.

How to Use it?

It's kind of hit and miss to find out how to make proper use of it as the official documentation of Mule has not provided yet a proper roadmap of API development. So, here are the basic steps you need to do. (Please read my previous article for more detail).

Step 1

Create an instance of the API.

Image title

Here, I'm creating an API instance named demo-instance

Step 2

Once the API instance is created, you will get an API instance ID. Implement the API in Anypoint Studio. In the implementation, you configure API Autodiscovery and provide the API instance ID. By doing so, you are telling the Anypoint Platform to automatically wire that instance of the API to the implementation.

Step 3

Once the application is deployed, copy the URL of the application. Now go the Exchange and look for the API asset. Navigate to API instances option of the API and configure the instance demo-instance with the implementation URL. Here is a snapshot:

Image title

Step 4

Once the API instances are defined, you can choose them to be executed for the API. Here is a screenshot:

Image title

In the figure above, we are executing the GET operation of the resource against the API instance chosen (demo-instance). All statistics for this operation will be registered in that particular instance. 

Conclusion

It's easy to make use of the API instance in the Anypoint Platform. 

A Small Experiment:

I performed a small experiment by creating two API instances (Basic Endpoint) for the same API and configuring two API Autodiscovery elements (providing the API instance IDs in the implementation. Here is the screenshot:

Image title

On deploying the application to Cloudhub, the instances were successfully auto-discovered.

Issue 1

I have configured the instances in Exchange for the API and made calls to an API operation for both of the instances. But unfortunately, only one of the instances registered the statistics.

Issue 2

Applied Client Id enforcement policy on instance-one. Unfortunately, the policy is applied to instance-two also automatically.

Remark

I will try to resolve this issue and write another article on it.

Thanks.

API

Opinions expressed by DZone contributors are their own.

Related

  • Source-Driven Development in Salesforce: Managing Metadata and API Versions
  • How to Introduce a New API Quickly Using Micronaut
  • Building a Real-Time Audio Transcription System With OpenAI’s Realtime API
  • Efficient API Communication With Spring WebClient

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!