Sub topic 6
MuleSoft Anypoint Platform at a glance
This chapter assumes you know what middleware does, as covered in the previous chapter: transformation, routing, security, and monitoring in a layer between systems. It also assumes you can read REST and JSON and know basic Salesforce objects. Here you get a map of MuleSoft's product, so you can judge later whether it fits a given integration.
What Anypoint Platform is
MuleSoft is a Salesforce company. Its product, Anypoint Platform, is a set of tools for designing, building, running, and managing APIs and integrations. Salesforce does not require it. It is one middleware option among others, such as Boomi, Informatica, Azure Integration Services, or a custom service you write yourself.
The platform is easier to understand as five jobs rather than one product:
| Job | Main component | What it does |
|---|---|---|
| Design | Anypoint Design Center, API specifications | Write API contracts (RAML or OpenAPI) before any code exists |
| Build | Anypoint Studio, Anypoint Code Builder | Develop flows in an IDE, with connectors and DataWeave |
| Run | Mule runtime, CloudHub, Runtime Fabric | Execute the integration applications |
| Share | Anypoint Exchange | Catalog of APIs, connectors, templates, and examples |
| Manage | API Manager, Anypoint Monitoring, Access Management | Apply policies, observe traffic, control who can do what |
Product names and packaging change over time, so check the current MuleSoft documentation before you plan a purchase. The five jobs stay the same.
The Mule runtime and flows
The Mule runtime is the engine that executes your integration logic. An integration is packaged as a Mule application. The application contains one or more flows, and each flow is a chain of steps that a message moves through.
A flow has two parts:
- A source that starts it, such as an HTTP listener, a scheduler, or a message-queue subscriber.
- A processor chain, the ordered steps that run for each message: call a connector, transform data, route by condition, log, or handle an error.
The message carries a payload (the body), attributes (headers, query parameters, and other metadata), and variables you set along the way.
A small flow you can read
This Mule 4 application accepts a JSON array of customers over HTTP and maps each one to Salesforce Account field names. It reuses the DataWeave mapping idea from the Topic Spine.
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/core http://www.mulesoft.org/schema/mule/ee/core/current/mule-ee.xsd">
<http:listener-config name="HTTP_Listener_config">
<http:listener-connection host="0.0.0.0" port="8081"/>
</http:listener-config>
<flow name="customersToAccountsFlow">
<http:listener config-ref="HTTP_Listener_config"
path="/customers"
allowedMethods="POST"/>
<ee:transform>
<ee:message>
<ee:set-payload><![CDATA[%dw 2.0
output application/json
---
payload map (customer) -> {
Name: customer.company_name,
BillingCity: customer.address.city,
External_Id__c: customer.id
}]]></ee:set-payload>
</ee:message>
</ee:transform>
<logger level="INFO"
message="#['Mapped ' ++ sizeOf(payload) ++ ' customers']"/>
</flow>
</mule>To send these records to Salesforce, you would add the Salesforce connector after the transform step and configure its connection. The flow shows the shape of the work: a source, a transform, and a next step. The tooling handles the plumbing.
Connectors
A connector is a prebuilt module that hides the details of talking to a system. The Salesforce connector, for example, wraps the Salesforce APIs (SOAP, REST, Bulk, and Streaming or Pub/Sub, depending on the operation) and handles authentication and session management. Other connectors cover databases, SFTP, SAP, queues, and generic HTTP.
Connectors matter in the build-versus-buy decision because they save a particular kind of work: authentication, pagination, retries on transient failures, and API version quirks. They do not save you from understanding the target system. You still have to know which Salesforce API suits a 5-million-row load.
Deployment options
You choose where the runtime executes. The choice drives cost and operational ownership, which a later chapter covers.
- CloudHub is MuleSoft's managed cloud hosting. MuleSoft runs the infrastructure and you deploy applications into workers.
- Runtime Fabric runs the Mule runtime on Kubernetes you manage, in your cloud account or data center.
- Standalone or customer-hosted runtime runs on servers you own. This usually suits systems that cannot be reached from the public cloud.
Hybrid setups are common. A team might run the runtime on-premises next to an ERP and still use the cloud-hosted control plane for management and monitoring.
Management features
Three components cover the governance and operations that native Salesforce tools do not.
- API Manager applies policies to an API without changing its code. Common policies include client ID enforcement, rate limiting, IP allowlists, and OAuth token validation.
- Anypoint Monitoring shows throughput, latency, error rates, and logs across applications, so you can trace one failing order across several systems.
- Anypoint Exchange is where teams publish reusable assets. Reuse is what makes the platform pay off. A "customer" API that three projects share costs less than three separate customer mappings.
DataWeave
DataWeave is the expression language used for transformation in Mule. It reads and writes JSON, XML, CSV, Java objects, and fixed-width formats, and the mapping above shows its basic style. The next chapters cover mapping in more depth. For now, note that DataWeave is the main skill a team needs on top of general integration knowledge.
Where Salesforce fits
Salesforce uses MuleSoft in several ways, and they are easy to confuse:
- Anypoint Platform is the full platform described in this chapter. You build and run your own integrations on it.
- Salesforce-specific accelerators and templates are prebuilt starting points for common scenarios such as syncing accounts or orders.
- Flow integration with MuleSoft (for example invoking a published API from a Flow) lets declarative builders call APIs that integration developers published.
That last point is relevant to ownership. A common split is that integration developers build and govern the APIs in Mule, and Salesforce admins consume them from Flow through an External Service or a Named Credential.
Common mistakes when evaluating the platform
- Treating it as a faster Apex callout. For one request to one REST endpoint, a Named Credential and an Apex callout (shown in an earlier chapter) is less to build and run. Mule earns its place when there are many systems, shared logic, or governance needs.
- Ignoring the runtime sizing. Mule applications run on workers or Kubernetes pods with fixed capacity. Large payloads and high concurrency need sizing and testing, and the runtime does not remove Salesforce API limits on the other side.
- Counting only license cost. Developer skills, environments, support, and monitoring add to the total. See the cost chapter for the full comparison.
- Skipping the design step. Teams that jump into Studio without an API contract in Design Center and Exchange lose the reuse that justifies the platform.
Summary
Anypoint Platform covers the whole life of an integration: design, build, run, share, and manage. The Mule runtime executes flows made of a source and processors, connectors hide system details, DataWeave handles mapping, and API Manager and Monitoring supply governance and visibility. Its value grows with the number of systems and the amount of reuse. Later chapters turn this overview into decision criteria.
Exercise
A team needs one Salesforce Flow to read the status of an order from a single REST endpoint that already returns clean JSON, with no other consumers planned. They propose building a Mule application on CloudHub. Using what you know about the five jobs of Anypoint Platform and the native options, explain whether the proposal fits, and name one fact that would change your answer.
Show answer
The proposal probably does not fit. The need is a single request-reply call to one endpoint with no transformation or other consumers, so the design, share, and manage components would go unused, and a Named Credential with an Apex callout or Flow HTTP callout covers it with less to build and run. The answer would change if, for example, the same order data had to be combined from several systems, if the endpoint required protocol mediation or complex mapping, or if several other applications needed the same governed API. Those facts bring in reuse, orchestration, and policy management, which are what the platform provides.
Exercise
In a Mule flow, what are the two parts of a flow, and which part would contain a DataWeave transformation?
Show answer
A flow has a source that starts it (such as an HTTP listener or scheduler) and a processor chain of ordered steps. The DataWeave transformation, usually in a Transform step, sits in the processor chain.