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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building Multi-Rail Payment Failover to Stop Latency Spikes and Double Debits
  • GET, POST, PUT, DELETE: Choosing HTTP Verbs in a Real .NET Core Web API, Not Just by the Textbook
  • Delegated Transport, Forked Authorization: Where Chat and AI-Agent Integrations Actually Break
  • A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces

Trending

  • PWA on iOS, Part 3: Chrome on iPhone Is WebKit Too. How One Engine Sets the Rules for PWAs on iOS
  • Beyond @Transactional: Solving the Dual-Write Problem in Distributed Microservices
  • Full-Text Search Meets the Graph: Apache Lucene Inside Neo4j
  • Why Successful Tech Transformation Starts With Clarity

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Databases
  4. API Autodiscovery in Anypoint Platform 2

API Autodiscovery in Anypoint Platform 2

Read this tutorial in order to learn how to use the API autodiscovery in Anypoint Platform 2.

By 
Anupam Gogoi
·
May. 24, 18 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
17.7K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

Introduction

With the release of Anypoint Platform 2, there are some changes in the API Autodiscovery feature. Here in this short article, I am going to describe how to make use of it in your applications.

API Road Map

This is the basic roadmap for API development in Anypoint Platform. I am not going to explain all the steps except the API Manager. 

Image titleAPI Manager

This is the most important tool for managing (governing) the APIs. An API, to be managed, must have an instance created, and this instance must be associated with an actual implementation of the API. Also, to apply necessary security policies the API instance is a must need. 

Note: Previously, in Anypoint Platform 1, there was the concept of creating a proxy for the API to manage it, but now, with the new version of Anypoint Platform, it can be done through the API instance. It means that you do not need to explicitly create a proxy only to apply some policy. Now you can directly apply the policies on the API instance. 

So, here is a screenshot to create an API instance,

Image title

Most important part is to mark the checkbox. Once you save the API instance is created as shown below:

Image title

This is the most important part of API autodiscovery. You can create more than one instance of the same API. Once the API instance is created you can have the instance ID as shown above.

At this stage, your API instance is not managed. (Status is shown as unregistered). It means that until now it has not yet been associated with an actual implementation. 

Image title

Anypoint Studio

After API specification is ready you can import it directly from the Design Center in the Anypoint Studio. Now, configure an API autodiscovery global element and provide it with the API Instance ID.

Image title

Runtime Manager

Once the implementation is complete, publish it to Runtime Manager. Before deploying, just make sure that you configure the following properties. This is the most important part, otherwise, your API will not be managed.

anypoint.platform.analytics_base_uri=https://analytics-ingest.anypoint.mulesoft.com/
anypoint.platform.client_id=<<>>
anypoint.platform.client_secret=<<>>
anypoint.platform.base_uri=https://anypoint.mulesoft.com/

Note: The client_id & client_secret are the credentials of your master organization or Business Group for whom you are developing the APIs.

Once the application is up and running, you can see the status of the API as active in the API manager.

Image title

Behind The Scene

At this stage, your API is completely managed by the platform. Any request that comes to the application endpoint, first it is intersected by the API manager and thereby it collects statistics etc. If you apply security policies (API Manager), the request will be intersected at the API manager and security policies will be applied.

Conclusion

In this tutorial, I have shown how to use the API Autodiscovery in Anypoint Platform 2. Now things have become much easier to understand and use with the release of the new version of the platform.

API

Opinions expressed by DZone contributors are their own.

Related

  • Building Multi-Rail Payment Failover to Stop Latency Spikes and Double Debits
  • GET, POST, PUT, DELETE: Choosing HTTP Verbs in a Real .NET Core Web API, Not Just by the Textbook
  • Delegated Transport, Forked Authorization: Where Chat and AI-Agent Integrations Actually Break
  • A Non-Expiring AKS Deployment Token Could Read Secrets Across Three Namespaces

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook