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 Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • MuleSoft: Tactical and Strategical Role of an Application Template
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal
  • MuleSoft IDP: Enhancing Efficiency and Accuracy in Data Extraction
  • From AI Chaos to Control: Building Enterprise-Grade LLM Gateways With MuleSoft Anypoint

Trending

  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  • Skills, Java 17, and Theme Accents
  • Data Contracts as the "Circuit Breaker" for Model Reliability
  • Optimizing High-Volume REST APIs Using Redis Caching and Spring Boot (With Load Testing Code)
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. How to Create a Template Project With Anypoint Studio and Mulesoft Exchange

How to Create a Template Project With Anypoint Studio and Mulesoft Exchange

You write process APIs by making a template process API and template item in Mulesoft Exchange.

By 
Jos Aikema user avatar
Jos Aikema
·
Dec. 15, 16 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
15.5K Views

Join the DZone community and get the full member experience.

Join For Free

For a project, I needed to write a couple of process APIs. These process APIs all consist of an HTTP connector followed by a Choice element. In this Choice element, a specific HTTP request is made to a system API. The choice is made based on the following query param:

(#[message.inboundProperties.'http.query.params'.brand == 'xxx']

I decided to make a template process API and create a template item in the Exchange (only visible for my account). In this tutorial, I will show how I did it.

Create and Export the Template Project

Make a normal Mule project with the needed elements:

Image title

This Mule project will be used as a template for the other process APIs. Therefore, we need to download the project from Anypoint Studio as a ZIP file. This can be done by right-clicking on the project in the Package Explorer and then choose for Anypoint Studio Project to Mule Deployable Archive (includes Studio metadata).

Image title

Create an Exchange Template

To add the template to Exchange, you need to put the ZIP file you just have created in a place on the internet that's accessible to the public. This can be somewhere on your website, in Dropbox, or in Google Drive. I have made the choice to put on a website.

Image title

In the Exchange, you can add different kinds of items. In this case, we choose a template to add.

Image title

Now, you have to fill in some general details regarding the API.

Image title

At the bottom, you can choose how your template will be provided to the world of Mulesoft developers. Click on Add and you can add a ZIP file.

Image title

You have to fill in a version number and you can choose in which way your template is available. In this case, I have uploaded it to a website and entered the link to the template ZIP. Click on Done, and on the next screen, click on Save new item. Your template is ready to serve!

Use Your Template in Anypoint Studio

Once you have created your template in Exchange, you can use it in Anypoint Studio as a template for a new project.

Image title

The items from the Exchange are loaded and you can now see all public items in the Exchange. In the top-right corner, you can log in with your Anypoint Platform account to see your own templates.

On the right side, you can choose which content should be shown. Choose your company (in my case, NextSense) and you will see your recently added template.

Image title










Click on Open and a new project will be created in Anypoint Studio based on your template.

Template MuleSoft

Opinions expressed by DZone contributors are their own.

Related

  • MuleSoft: Tactical and Strategical Role of an Application Template
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal
  • MuleSoft IDP: Enhancing Efficiency and Accuracy in Data Extraction
  • From AI Chaos to Control: Building Enterprise-Grade LLM Gateways With MuleSoft Anypoint

Partner Resources

×

Comments

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

  • 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