How to Create a Proxy in MuleSoft: A Step-By-Step Guide

API proxies are the secret weapons of modern API management that stand between your applications and underlying APIs, providing that critical layer of control without the complexity. They give you the power to transform, secure, and monitor your API traffic without touching the backend services themselves, acting as intermediaries that protect your backend services while giving you the flexibility to update without breaking client applications.

Whether you're looking to enhance security, optimize performance, or gain better visibility into your API traffic, MuleSoft's proxy capabilities deliver impressive results with (somewhat) minimal effort. Keep reading and we’ll show you how you can create and leverage these powerful tools to transform your API strategy from good to unstoppable.

Why Your APIs Are Begging for a MuleSoft Proxy#

API proxies in MuleSoft aren't just fancy middleware - here's some key features:

Enhanced Security#

When it comes to API security, you're only as strong as your front line. MuleSoft's proxies serve as that crucial defensive barrier by:

  • Implementing robust authentication practices and authorization before requests touch your backend
  • Applying security policies like OAuth 2.0 and API keys without modifying implementation code
  • Creating consistent security measures across your entire API portfolio through secure API proxy creation
  • Filtering malicious requests before they reach sensitive systems

Efficient Traffic Management#

When traffic surges hit, your APIs need to handle the pressure without buckling.

  • Rate limiting and throttling prevent backend meltdowns during peak loads
  • Load balancing distributes requests evenly across servers for optimal performance
  • Traffic prioritization ensures critical operations never get bottlenecked
  • Graceful degradation keeps everything running even when components fail

Reduced Latency and Improved Performance#

MuleSoft's proxy caching capabilities can slash response times:

  • Response caching for frequently requested data reduces backend calls
  • Response times can drop from seconds to milliseconds with proper caching policies
  • Compression reduces payload sizes for faster transmission

Monitoring and Analytics#

Flying blind with APIs is asking for trouble. MuleSoft's Anypoint Platform provides visibility tools:

  • Real-time dashboards track request volumes, response times, and error rates
  • Anomaly detection spots potential issues before they become outages
  • Usage analytics reveal which endpoints are most valuable to your users, providing API analytics insights
  • Performance metrics help identify and eliminate bottlenecks

Versioning and Lifecycle Management#

APIs evolve, and proxies make this evolution painless for everyone involved:

  • Support multiple API versions simultaneously to prevent breaking changes
  • Gradually phase out deprecated endpoints without disrupting consumers
  • A/B test new features before full rollout
  • Maintain backward compatibility while introducing innovations

The MuleSoft Playground: Understanding Your Environment#

Before creating your first proxy, you need to know the landscape you'll be working in. MuleSoft's Anypoint Platform isn't just another tool—it's a huge ecosystem that combines iPaaS capabilities with full API lifecycle management. This unified approach means you can securely develop, deploy, and manage APIs and integrations at scale without juggling multiple platforms - but it can also be confusing to navigate.

Anypoint API Manager#

Think of API Manager as your command center for everything API-related, offering essential proxy features. With this powerful hub, you can:

  • Create API proxies with visual tools rather than coding
  • Apply security and operational policies through simple configurations
  • Monitor usage patterns and performance metrics in real-time
  • Control API versions and lifecycle stages from a central dashboard

This centralized approach means consistent governance without sacrificing developer autonomy—the perfect balance for growing API programs.

Anypoint Runtime Manager#

Working in tandem with API Manager, Runtime Manager handles the operational side of your proxies:

  • Deploy proxies to different environments with predictable results
  • Monitor health metrics and performance in real-time dashboards
  • Configure alerts for proactive issue resolution
  • Scale resources up or down based on actual demand
  • Implement zero-downtime updates for continuous improvement

There's also Anypoint Flex Gateway which is an environment you can use to manage deployments and API Designer that's a visual interface for building APIs - but you don't need to know too much about them for this tutorial.

Building Your First MuleSoft Proxy: A No-Fluff Guide#

Ready to create your first API proxy in MuleSoft? I've broken down this process into digestible steps that work in real-world scenarios, not just theoretical examples. Let's build proxies that deliver tangible benefits from day one.

1. Setting the Stage#

Before writing a single line of code, make sure your environment is properly configured:

  • MuleSoft Account: Secure access to Anypoint Platform with appropriate permissions
  • Mule Runtime: Confirm compatibility (Mule 3.8.7, 3.9.1, 4.1.2, or later versions)
  • Anypoint Studio: Install this IDE for designing and testing proxy applications
  • Deployment Target: Decide between CloudHub or on-premises deployment

2. Crafting Your OpenAPI#

Every proxy starts with a clear definition of what it needs to do:

  1. Open Anypoint Studio and create a new Mule project
  2. Develop a OpenAPI specification that defines:
    • Your endpoints and supported methods
    • Request/response schemas for data validation
    • Data types to maintain structure
    • Example payloads for documentation and testing

Remember: a well-defined API isn't just documentation—it's the foundation for automated testing, documentation, and client SDK generation.

3. Building the Proxy#

Now for the fun part—assembling your proxy's components:

  1. In Anypoint Studio, use the Mule palette to create a flow connecting clients to your backend
  2. Add these essential components:
    • HTTP Listener: The entry point for client requests
    • HTTP Request: The connector to your backend service
  3. Configure each component with appropriate URLs, ports, and paths
  4. Implement any necessary transformations between request and response

4. Deploying Your Creation#

Your proxy is ready to meet the world! Here's how to deploy it:

CloudHub Deployment:

  1. Package your application as a .jar file
  2. Log in to Anypoint Platform and navigate to Runtime Manager
  3. Click "Deploy application" and upload your package
  4. Configure runtime version and worker size based on expected load
  5. Launch your proxy and watch it spring to life

On-Premises Deployment:

  1. Ensure your Mule runtime environment is properly configured
  2. Deploy your application using Mule commands or Runtime Manager
  3. Configure environment-specific variables as needed

5. Registering in API Manager#

Now let's bring your proxy under management:

  1. Navigate to API Manager in Anypoint Platform
  2. Select "Add API" and choose "Proxy an existing API"
  3. Enter your API details and implementation URI
  4. Configure proxy settings, including base path and version

6. Testing and Verification#

Never trust a proxy you haven't tested:

  1. Use Postman or cURL to send requests to your proxy endpoint
  2. Verify responses match expectations for different scenarios
  3. Check API Manager to confirm policies are enforcing correctly
  4. Monitor logs for any unexpected behavior
  5. Run through all endpoints and methods systematically

The difference between a working proxy and a production-ready proxy is thorough testing. Don't skip this crucial step!

When Things Go Sideways: Troubleshooting Your Proxy#

Even perfectly planned proxies hit roadblocks. Here's how to quickly overcome the most common issues without losing your sanity.

Authentication and Access Headaches#

When credentials or permissions cause problems:

  • Double-check that all credentials are current and correctly formatted
  • Verify API permissions match your actual needs
  • Check for expired OAuth tokens or API keys
  • Confirm that your client ID has the necessary scopes

For deeper authentication issues, MuleSoft's documentation provides specific solutions for API provisioning problems.

HTTPS Configuration Challenges#

Getting "405 Not Allowed" errors with HTTPS URLs? Focus on these common culprits:

  • TLS context configuration mismatches
  • Incorrect keystore settings
  • Certificate validation issues
  • Load balancer HTTPS termination problems

The MuleSoft community forum offers targeted solutions based on real-world experiences.

Performance Bottlenecks#

If your proxy is adding unacceptable latency:

  • Remove unnecessary features and transformations
  • Apply only essential policies—each one adds processing overhead
  • Optimize DataWeave transformations for efficiency
  • Implement strategic caching for frequently requested data
  • Monitor and analyze performance metrics to identify specific bottlenecks

Security Implementation Issues#

For challenges with security policies:

  • Verify policy configuration parameters match your requirements
  • Check for conflicts between multiple security policies
  • Ensure client applications are sending required security headers
  • Test with simplified security before adding complexity

Is Mulesoft A Good API Proxy Solution#

Although Mulesoft is powerful, as shown above, its difficult to navigate, requires configuration of multiple services, and its easy to run into a myriad of issues when setting up a simple proxy. You probably wouldn't be searching up a guide if you thought it was easy!

A popular Mulesoft alternative that combines many of these products into one is Zuplo. Let's take a quick dive into setting up a proxy using Zuplo.

Setting Up A Proxy Using Zuplo#

Getting started with Zuplo is pretty simple. First step is to sign up and create a project.

Create a project

Once your project is created, you can either clone your project locally within your editor of choice using npm

npx create-zuplo-api@latest api-proxy --install
cd api-proxy

or use the Web UI to start building your project

Web UI

Either way, your next destination will be the routes.oas.json file. Zuplo is OpenAPI-native, meaning your OpenAPI specification generates your gateway configuration.

To get a quick proxy running, go to the pre-populated /hello route and change the request handler to the URL Rewrite handler. This handler with rewrite requests from your gateway and route them to your backend. In this case, we are proxying echo.zuplo.io - a test endpoint we set up.

URL rewrite handler

If developing locally, your OpenAPI file will now look like this:

{
  "openapi": "3.1.0",
  "info": {
    "version": "1.0.0",
    "title": "My Zuplo API"
  },
  "paths": {
    "/hello": {
      "x-zuplo-path": {
        "pathMode": "open-api"
      },
      "get": {
        "summary": "Hello World",
        "description": "This is the first route to say hello",
        "x-zuplo-route": {
          "corsPolicy": "none",
          "handler": {
            "export": "urlRewriteHandler",
            "module": "$import(@zuplo/runtime)",
            "options": {
              "rewritePattern": "https://echo.zuplo.io/"
            }
          },
          "policies": {
            "inbound": []
          }
        },
        "operationId": "004ff0e0-30cf-41a7-9e9f-zuplo35e3f725"
      }
    }
  }
}

Feel free to change the rewritePattern to whatever an API endpoint you're hosting somewhere.

Save your changes. If you're on the web UI - this will automatically trigger a new deployment. If you're developing locally - you will need to run the following command:

npx @zuplo/cli deploy --project api-proxy --environment main --apiKey "<YOUR_API_KEY>"

The deployment should only take a few seconds. Once it's complete, you can easily test your API with curl.

cURL -X GET https://api-proxy-main-7342c90.d2.zuplo.dev/hello

It's that simple - you designed and developed an API proxy in just a few minutes. To learn how to apply policies and write custom logic, check out the Zuplo documentation.

Zuplo vs Mulesoft: Which is the Better API Proxy & Gateway Solution#

Here’s a side-by-side comparison of Zuplo and MuleSoft’s Anypoint Platform as API gateways:

FeatureZuploMuleSoft Anypoint
Routing & Proxying• OpenAPI-driven route builder
• Native support for REST, GraphQL, and WebSockets
• Fast edge-optimized proxy
• Centralized design center with visual flow designer
• Supports REST, SOAP, MQ, and more
• Built-in transformation and orchestration layer
Security• Customizable distributed rate limiting
• API security linting integration
• Integrated with major WAF providers like Cloudflare
• Comprehensive security policies (WAF, IP whitelisting, SAML, mTLS)
• DataWeave for payload sanitization
Authentication & Authorization• Out-of-the-box JWT/OIDC policy editor
• API key management UI with per-key quotas
• Plug-and-play integrations (Okta, Auth0, etc.)
• Native OAuth2/JWT filters
• LDAP, SAML, custom identity provider connectors
Rate Limiting & Throttling• Built-in rate-limit and quota policies by key, IP, header, or whatever you want
• Real-time dashboard for usage monitoring
• Throttling and SLA tiers via policies in API Manager
• Flexible rate-limit expressions and schedule rules
• Alerts and SLA breach notifications
Policy Management• Low-code policy editor with drag-and-drop application
• Pre-made library of security, transformation, caching policies
• Write your own policies using the embedded Typescript runtime and node modules
• Central policy repository in Exchange
• Versioned policy lifecycle (draft, published, applied)
Customization & Extensibility• Typescript runtime for bespoke logic
• Webhooks and REST API for integrations
• DataWeave for complex transformations
• Java/.NET custom extensions
• Mule runtimes support custom connectors and modules
Observability & Analytics• Built-in metrics, logs, traces in a unified dashboard
• Prometheus/Grafana and Jaeger exporters via OpenTelemetry
• Runtime Manager metrics and alerts
• Anypoint Monitoring with dashboards, alerts, and anomaly detection
• Runtime Fabric for self-hosted telemetry
Deployment & Operations• SaaS, managed-dedicated on major clouds (ex. AWS), or self-hosted via Docker/K8s
• Deploy via CLI & gitops with unlimited test environments for pull requests
• Hybrid deployment: CloudHub, on-prem, or RTF (K8s)
• CI/CD pipelines via Maven plugins
Performance & Scalability• Edge-native, single-digit-ms latency for simple flows
• Scales horizontally with minimal ops
• Enterprise-grade clusters capable of handling very high throughput
• JVM-based, so warm-up considerations and tuning required
Pricing & Licensing• Predictable usage-based pricing
• Free tier for prototyping
• No per-core or per-node fees
• Subscription tiers (Gold, Platinum, Titanium) with per-node and per-core pricing
• Add-ons for advanced capabilities can increase costs significantly
Community & Support• Growing community focused on rapid API adoption and API-as-a-product
• Commercial support suited to both startups and enterprises
• Large enterprise customer base
• Extensive training, certification, and partner ecosystem

Zuplo shines when you need a lightweight, developer-friendly gateway with programmable policies, edge performance, and affordability. MuleSoft’s Anypoint Platform, by contrast, offers a deeply integrated suite for complex enterprise integration needs—at the price of greater operational overhead, high costs, and license complexity. Your choice will hinge on whether you prioritize developer experience, time-to-market, easy tooling integration, API governance, and API productization (Zuplo) or composable and low-code enterprise features (Mulesoft).

Your Next Move: From Proxy Beginner to API Master#

Well-designed proxies form the backbone of a modern API strategy by providing that crucial abstraction layer that lets you implement policies, manage traffic, and monitor everything without touching backend services.

That's not just convenient—it's transformative for teams trying to move fast while maintaining control. The step-by-step approach we've covered helps you build proxies that deliver real benefits: better security, improved monitoring, and enhanced performance.

Ready to take the next step in your API management journey? Sign up for a free Zuplo account today and experience managed API solutions that combine the power of enterprise tools with the flexibility developers love. Your APIs—and the developers who use them—will thank you!

Questions? Let's chatOPEN DISCORD
0members online

Designed for Developers, Made for the Edge