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

  • Your Application Has an Unindexed Attack Surface. Do You Know What’s in It?
  • Retrieval Augmented Generation With Spring AI 2.0, Claude, and PGvector
  • Why Mocking Sucks
  • How to Enhance the Performance of .NET Core Applications for Large Responses

Trending

  • Controller and Data Access: Understanding Two-Layer Architecture Through Abstraction and Encapsulation
  • Foxit MCP Server: Give AI Agents Direct Access to 30+ PDF Tools via Model Context Protocol
  • Python Asyncio: Understanding Concurrency With a Scraper
  • Chaos Engineering and Kafka In Action: Topic Level Idempotence and Retry Check

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. Using API Autodiscovery in Anypoint Platform

Using API Autodiscovery in Anypoint Platform

In this article, see how to use and configure API Autodiscovery in Anypoint Platform.

By 
Kuldeep Rana
·
Updated Jun. 12, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
27.9K 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

In this article, I'll be showing you how to use and configure API Autodiscovery in Anypoint Platform.

What Is API Autodiscovery?

We use API Autodiscovery to pair an API in API Manager to its deployed Mule application.

Setting up autodiscovery allows API Manager to manage the API. When set up correctly, it shows the API status represented as a green dot if the API is being tracked (active) or a gray dot if untracked (unregistered).

By configuring autodiscovery, you can use policy management and API Analytics accessed from within API Manager.

When autodiscovery is correctly configured in your Mule application, you can say that your application’s API is tracked by or paired to API Manager.

NOTE: An API in a Mule runtime can only be associated with one autodiscovery instance. No two Autodiscoveries can be associated to the same API in a Mule Runtime.

Step 1: CREATE AN API

Create a sample API specification in the Design Center. Below is the sample of the RAML file created:

Image title

Step 2: TEST THE API

The test is done by enabling the mocking service to see if it is working fine or not. If there are any issues,  check out the RAML in the design center and test it again.

If there are no errors, Publish it to Exchange.

Step 3: Manage the API in API manager

Once the RAML is published in Exchange, it needs to be managed in the API manager.

In the API MANAGER tab in Anypoint Platform, click on Manage API and select Manage API from Exchange.

Enter the API name. Select Managing type as Basic Endpoint. Check the box for the Mule version as we are managing it in Mule4.

Once you save the configuration, the API will visible in the API manager but the status of the API will be "UNREGISTERED".

It means that until now, it has not yet been associated with an actual implementation.

The most important thing to notice in the API is the API Autodicovery tag.

This will help us to pair the API in the API Manger to its deployed Mule Application.

Step 4: CREATE A MULE PROJECT

Go to Anypoint studio. Create a Mule Project, and import the newly created API from the design center. You can do any necessary changes required according to your requirement.

Step 5. Configuring Autodiscovery

(a) Click on the Global Elements on the canvas.

(b) Click Create àComponent Configurations à API Autodiscovery.

Image title

(c) In the Global Element Properties Window, set the API Id with the Autodiscovery Id of the API in the API Manager Anypoint Platform and the flow name to the main flow of the API implementation.

Image title

Step 6: TESTING AND DEPLOYING

Test the application to see if it is running fine without any errors.

Once the application is running successfully, deploy the application to cloudhub.

Step 7: Runtime Manager

In the Anypoint Platform window that opens up, in the properties tab of the Anypoint Platform window (shown in the image below), set two properties:

the client_id and the client_secret

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

Image title

Once you set the Client Id and Client Secret, Deploy the application.

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

Conclusion

In this article, I have shown you how to use the API Autodiscovery to pair an API in the API Manager to its deployed Mule Application.

Now, any request that comes to the application passes by the API Manager.

If we apply policies to the API in the API Manager, the request will pass by or intersect the API Manager, and the policies will be applied to it.

API application

Opinions expressed by DZone contributors are their own.

Related

  • Your Application Has an Unindexed Attack Surface. Do You Know What’s in It?
  • Retrieval Augmented Generation With Spring AI 2.0, Claude, and PGvector
  • Why Mocking Sucks
  • How to Enhance the Performance of .NET Core Applications for Large Responses

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