Salesforce-MuleSoft-Developer-II Exam Questions With Explanations
The best Salesforce-MuleSoft-Developer-II practice exam questions with research based explanations of each question will help you Prepare & Pass the exam!
Over 15K Students have given a five star review to SalesforceKing
Why choose our Practice Test
By familiarizing yourself with the Salesforce-MuleSoft-Developer-II exam format and question types, you can reduce test-day anxiety and improve your overall performance.
Up-to-date Content
Ensure you're studying with the latest exam objectives and content.
Unlimited Retakes
We offer unlimited retakes, ensuring you'll prepare each questions properly.
Realistic Exam Questions
Experience exam-like questions designed to mirror the actual Salesforce-MuleSoft-Developer-II test.
Targeted Learning
Detailed explanations help you understand the reasoning behind correct and incorrect answers.
Increased Confidence
The more you practice, the more confident you will become in your knowledge to pass the exam.
Study whenever you want, from any place in the world.
Salesforce Salesforce-MuleSoft-Developer-II Exam Sample Questions 2025
Start practicing today and take the fast track to becoming Salesforce Salesforce-MuleSoft-Developer-II certified.
2604 already prepared
Salesforce Spring 25 Release60 Questions
4.9/5.0
A healthcare portal needs to validate the token that it sends to a Mule API. The developer plans to implement a custom policy using the HTTP Policy Transform Extension to match the token received in the header from the heathcare portal. Which files does the developer need to create in order to package the custom policy?
A. Deployable ZIP file, YAML configuration file
B. JSON properties file, YAML configuration file
C. JSON propertiesfile, XML template file
D. XML template file, YAML configuration file
Explanation:
Let’s dive into creating a custom policy for a Mule API to validate a token from a healthcare portal using the HTTP Policy Transform Extension! The goal is to understand which files are needed to package this custom policy, and we’ll work through it step by step to ensure the developer has everything required.
In MuleSoft, custom policies extend the API gateway’s capabilities, allowing developers to enforce specific logic—like token validation—using the Policy Transform Extension. These policies are packaged and deployed to the API gateway, and the packaging process involves specific file types. The HTTP Policy Transform Extension, in particular, supports defining policy logic and configuration through structured files that the gateway can interpret.
Custom policies typically require two main components:
➡️ An XML template file (e.g., policy.xml): This file defines the policy’s structure, including the logic for matching and validating the token in the HTTP header. It uses Mule’s XML-based configuration to specify how the policy interacts with the request and response, leveraging the Transform Extension to apply custom transformations or validations.
➡️ A YAML configuration file (e.g., config.yaml): This file provides metadata about the policy, such as its name, version, and supported operations. It also defines the policy’s parameters and how it integrates with the API gateway, ensuring the policy is properly registered and configurable in Anypoint Platform.
Now, let’s evaluate the options:
❌ A. Deployable ZIP file, YAML configuration file
A deployable ZIP file is the final packaged artifact containing all policy files, but it’s not a file to create—it’s the result of packaging. The YAML configuration file is needed, but this option misses the XML template file, which is essential for defining the policy logic. This is incomplete.
❌ B. JSON properties file, YAML configuration file
A JSON properties file isn’t a standard component for custom policy packaging in MuleSoft. The YAML configuration file is required for metadata, but without an XML template to define the policy’s behavior (like token validation), this setup won’t work. This is incorrect.
❌ C. JSON properties file, XML template file
Again, a JSON properties file isn’t typically used for policy packaging. The XML template file is necessary for the policy logic, but the absence of a YAML configuration file means the policy lacks metadata and integration details. This is insufficient.
✅ D. XML template file, YAML configuration file
This hits the mark. The XML template file defines the custom policy’s logic, such as using the HTTP Policy Transform Extension to match the token in the header. The YAML configuration file provides the policy’s metadata and configuration options, ensuring it’s properly deployed and managed. Together, these files allow the developer to package the policy into a ZIP file for deployment.
To implement this, the developer would create a policy.xml file with the token validation logic (e.g., using a Transform Message to check the header) and a config.yaml file with the policy’s name, version, and parameters. These files are then zipped into a deployable package.
✅ Answer: D
To package a custom policy using the HTTP Policy Transform Extension, the developer needs an XML template file to define the policy logic (e.g., token validation in the HTTP header) and a YAML configuration file for metadata and configuration. These files work together to enable the policy’s deployment and execution on the Mule API gateway.
Reference:
MuleSoft Documentation on Custom Policies and HTTP Policy Transform Extension.
Refer to the exhibit.
A Mute Object Store is configured with an entry TTL of one second and an expiration
interval of 30 seconds.
What is the result of the flow if processing between os’store and os:retrieve takes 10
seconds?
A. nullPayload
B. originalPayload
C. OS:KEY_NOT_FOUND
D. testPayload
Explanation:
In MuleSoft, the Object Store (os:store and os:retrieve) manages key-value pairs with a Time to Live (TTL) setting that determines how long an entry remains valid before expiration. Here, the os:object-store is configured with entryTtl="1" (1 second) and entryTtlUnit="SECONDS", meaning each stored entry expires after 1 second unless accessed or refreshed. The expirationInterval="30" and expirationIntervalUnit="SECONDS" define how often the Object Store checks for expired entries, set to every 30 seconds. When the flow executes, the os:store operation stores the payload (testPayload from #[CDATA[#['testPayload']]) under the key #[testKey] at time T0. If processing between os:store and os:retrieve takes 10 seconds, the retrieval occurs at T10. Since the TTL is 1 second, the entry expires 1 second after storage (at T1), well before the retrieval at T10. The os:retrieve operation returns the default-value (#[nullPayload]) when the key is no longer found due to expiration. MuleSoft’s documentation on Object Store (Mule 4) confirms that entries expire based on the entryTtl, and retrieval returns the default value if the entry is expired or missing.
❌ Incorrect Answers:
B. originalPayload
The originalPayload is set earlier in the flow with
C. OS:KEY_NOT_FOUND
The OS:KEY_NOT_FOUND error or value is not a default return from the os:retrieve operation. When a key is not found or has expired, os:retrieve returns the specified default-value (in this case, #[nullPayload]) rather than an error code like OS:KEY_NOT_FOUND, unless an error handler is configured to catch and handle such cases. MuleSoft’s documentation on Object Store operations notes that os:retrieve gracefully returns the default value for missing or expired keys.
D. testPayload
The testPayload is the value stored in the Object Store via os:store. However, because the TTL is 1 second and processing takes 10 seconds, the entry expires long before the os:retrieve operation occurs. Therefore, testPayload is not returned. MuleSoft’s Object Store configuration guide emphasizes that TTL enforcement causes entries to expire after the specified duration, affecting retrieval outcomes.
🧩 Additional Context:
The expirationInterval of 30 seconds determines how frequently the Object Store checks for expired entries, but it does not extend the TTL of individual entries. The TTL of 1 second is the critical factor here, as it governs when the testPayload entry becomes invalid. Since 10 seconds exceeds the 1-second TTL, the entry is expired by the time retrieval is attempted, resulting in the default nullPayload.
🧩 Summary:
Option A is correct because the Object Store entry expires after 1 second due to the entryTtl setting, and after 10 seconds of processing, os:retrieve returns the default-value of nullPayload. Options B (originalPayload), C (OS:KEY_NOT_FOUND), and D (testPayload) are incorrect because they do not reflect the expiration behavior or the default value returned by os:retrieve.
ℹ️ References:
MuleSoft Documentation: Object Store (Mule 4) – Describes how entryTtl defines the expiration time for stored entries and how os:retrieve returns the default value when a key is expired.
MuleSoft Documentation: Object Store Configuration – Explains the distinction between entryTtl (entry expiration) and expirationInterval (check frequency), with TTL taking precedence for individual entry validity.
A mule application exposes and API forcreating payments. An Operations team wants to ensure that the Payment API is up and running at all times in production. Which approach should be used to test that the payment API is working in production?
A. Create a health check endpoint that listens ona separate port and uses a separate HTTP Listener configuration from the API
B. Configure the application to send health data to an external system
C. Create a health check endpoint that reuses the same port number and HTTP Listener configuration as the API itself
D. Monitor the Payment API directly sending real customer payment data
Explanation:
To ensure the Payment API is up and running in production, the best approach is:
✅ A. Create a health check endpoint that listens on a separate port and uses a separate HTTP Listener configuration from the API.
Why a health check endpoint: A health check endpoint is a standard practice to monitor the availability and operational status of an API without impacting its core functionality. It provides a lightweight way to verify the API's health (e.g., connectivity, dependencies, and runtime status) without processing sensitive or real data.
Why a separate port and HTTP Listener: Using a separate port and HTTP Listener configuration for the health check endpoint isolates it from the main API traffic. This reduces the risk of interference with production traffic, enhances security by limiting exposure, and allows independent scaling or monitoring of the health check. It also ensures the health check is not affected by issues like API throttling or authentication requirements.
❌ Why not the other options:
B. Configure the application to send health data to an external system: While sending health data to an external system (e.g., monitoring tools like Splunk or New Relic) is useful for observability, it does not directly provide a way for the Operations team to actively check the API's availability in real-time. It’s a passive approach and may require additional setup or dependencies.
C. Create a health check endpoint that reuses the same port number and HTTP Listener configuration as the API itself: Reusing the same port and HTTP Listener mixes health check traffic with production API traffic, which can lead to performance impacts, security risks (e.g., exposing health check details to clients), or complications with authentication and routing. It’s less reliable for isolated monitoring.
D. Monitor the Payment API directly sending real customer payment data: Using real customer payment data for monitoring is highly risky, unethical, and likely violates compliance regulations (e.g., PCI DSS for payment systems). It could also lead to unintended side effects, such as duplicate transactions or data exposure.
ℹ️ Reference:
MuleSoft Documentation: Monitoring Applications and HTTP Listener Configuration
A Mule implementation uses a HTTP Request within an Unit Successful scope to connect to an API. How should a permanent error response like HTTP:UNAUTHORIZED be handle inside Until Successful to reduce latency?
A. Configure retrying until a MULERETRY_EXHAUSTED error is raised or the API responds back with a successful response.
B. In Until Successful configuration, set the retry count to 1 for error type HTTP: UNAUTHORIZED.
C. Put the HTTP Request inside a try scope in Unit Successful.
In the error handler, use On Error Continue to catch permanent errors like HTTP
UNAUTHORIZED.
D. Put the HTTP Request inside a try scope in Unit Successful.
In the error handler, use On Error Propagate to catch permanent errors like HTTP
UNAUTHORIZED.
In the error handler, use On Error Continue to catch permanent errors like HTTP UNAUTHORIZED.
Explanation:
To reduce latency when handling a permanent error response like HTTP:UNAUTHORIZED in a Mule implementation using an Until Successful scope, the best approach is:
✅ C. Put the HTTP Request inside a try scope in Until Successful. In the error handler, use On Error Continue to catch permanent errors like HTTP:UNAUTHORIZED.
Why HTTP:UNAUTHORIZED should not be retried: HTTP:UNAUTHORIZED (401) is a permanent error, indicating that the request lacks valid authentication credentials. Retrying the same request without modifying the credentials will not resolve the issue and will only increase latency due to unnecessary retries.
Why use a Try Scope with On Error Continue: Placing the HTTP Request inside a Try scope within the Until Successful scope allows you to handle errors explicitly. Using On Error Continue for HTTP:UNAUTHORIZED ensures that the flow continues without retrying the request, as this error is not transient. This approach minimizes latency by avoiding futile retry attempts and allows the flow to proceed with alternative logic (e.g., logging, fallback, or response handling).
❌ Why not the other options:
A. Configure retrying until a MULE:RETRY_EXHAUSTED error is raised or the API responds back with a successful response: This approach would cause the Until Successful scope to keep retrying the request, even for a permanent error like HTTP:UNAUTHORIZED. This increases latency unnecessarily, as the error will not resolve without changing the credentials.
B. In Until Successful configuration, set the retry count to 1 for error type HTTP:UNAUTHORIZED: While setting a low retry count reduces the number of attempts, it still introduces unnecessary retries for a permanent error. It’s better to avoid retries altogether for HTTP:UNAUTHORIZED.
D. Put the HTTP Request inside a try scope in Until Successful. In the error handler, use On Error Propagate to catch permanent errors like HTTP:UNAUTHORIZED: Using On Error Propagate will propagate the error up the flow, potentially stopping the Until Successful scope or the entire flow. This does not allow the flow to continue gracefully, which is often undesirable for handling permanent errors like HTTP:UNAUTHORIZED.
How it works in Mule:
➤ The Until Successful scope retries the enclosed logic for transient errors until a success condition is met or the retry limit is exhausted.
➤ By wrapping the HTTP Request in a Try scope and configuring an On Error Continue handler for HTTP:UNAUTHORIZED, you can catch the error, handle it (e.g., log it or return a custom response), and allow the flow to proceed without retrying the failed request.
➤ This approach ensures minimal latency by avoiding unnecessary retries for permanent errors while still allowing the Until Successful scope to handle transient errors appropriately.
Reference:
MuleSoft Documentation: Error Handling and Until Successful Scope
A developer deploys an API to CloudHub and applies an OAuth policy on API Manager. During testing, the API response is slow, sothe developer reconfigures the API so that the out-of-the-box HTTP Caching policy is applied first, and the OAuth API policy is applied second. What will happen when an HTTP request is received?
A. In case of a cache hit, both the OAuth and HTTP Caching policies are evaluated; then the cached response is returned to the caller
B. In case of a cache it, only the HTTP Caching policy is evaluating; then the cached response is returned to the caller
C. In case of a cache miss, only the HTTP Caching policy is evaluated; then the API retrieves the data from the API implementation, and the policy stores the data to be cached in Object Store
D. In case of a cache miss, both the OAuth and HTTP Caching policies are evaluated; then the API retrieves the data from the API implementation, and the policy does not store the data in Object Store
Explanation:
✅ B. When an HTTP Caching policy is applied first in API Manager, it checks for a cache hit before other policies (like OAuth) are evaluated. If a cache hit occurs at 09:39 AM PST on August 01, 2025, the cached response is returned immediately, bypassing the OAuth policy and subsequent processing, as the request is already satisfied from the cache. This improves performance by reducing latency.
❌ A. In case of a cache hit, both the OAuth and HTTP Caching policies are evaluated; then the cached response is returned to the caller: Incorrect because a cache hit stops further policy evaluation, including OAuth, to optimize performance. Evaluating both policies would defeat the caching purpose.
❌ C. In case of a cache miss, only the HTTP Caching policy is evaluated; then the API retrieves the data from the API implementation, and the policy stores the data to be cached in Object Store: Incorrect because a cache miss triggers all applicable policies (including OAuth) before data retrieval and caching, not just the caching policy.
❌ D. In case of a cache miss, both the OAuth and HTTP Caching policies are evaluated; then the API retrieves the data from the API implementation, and the policy does not store the data in Object Store: Incorrect because on a cache miss, the HTTP Caching policy should store the retrieved data in the Object Store for future use, unless explicitly configured otherwise.
🧩 Reference:
MuleSoft Documentation: API Manager Policies – Explains that caching policies short-circuit the policy chain on a cache hit, evaluating only the caching policy.
Prep Smart, Pass Easy Your Success Starts Here!
Transform Your Test Prep with Realistic Salesforce-MuleSoft-Developer-II Exam Questions That Build Confidence and Drive Success!