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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
  1. DZone
  2. Data Engineering
  3. Databases
  4. API Autodiscovery in Mule3

API Autodiscovery in Mule3

Find out what API Autodiscovery is and see how to create a sample API specification.

Kuldeep Rana user avatar by
Kuldeep Rana
·
Aug. 13, 19 · Tutorial
Like (1)
Save
Tweet
Share
11.58K Views

Join the DZone community and get the full member experience.

Join For Free

What Is API Autodiscovery?

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

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. Through the Autodiscovery scheme, the API Manager keeps track of the API throughout its lifecycle.

Only one API can be associated with one Autodiscovery instance.

Step 1: Create an API in the Design Center

Create a sample API specification:

Image title

Step 2: Test the API

Enable the Mocking service and test if it is working fine. If there are no issues, publish it to Exchange as an asset.

Step 3: Manage the API

Once the API is published in Exchange, Manage it in 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.

Note: Do Not Check the box for the Mule version, as we are managing it in Mule3.

Once you save the configuration, the API will be 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 look out here is the Autodiscovery section, which has an API name and an API version.

Step 4: Create a Mule Project

After this, go to Anypoint Studio and create a Mule Project and import the newly created API from the design center. The necessary xml file will be generated with the flows inside it.

Step 5. Configuring Autodiscovery

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

(b) Click Create and search for API Autodiscovery.

Image title

(c) In the Global Element Properties Window, set the API NAME, API Version, and Flow Name from the managed API in the API Manager.

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 Runtime Manager, set the application name and click the deploy application option.

Note: Make sure that your Anypoint Studio is set with the client id and client secret of your current account of Anypoint Platform.

Image title

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

Image title


Thank you!

API application

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Visual Network Mapping Your K8s Clusters To Assess Performance
  • Core Machine Learning Metrics
  • Promises, Thenables, and Lazy-Evaluation: What, Why, How
  • Type Variance in Java and Kotlin

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: