Salesforce-MuleSoft-Developer-II Practice Test

Salesforce Spring 25 Release
60 Questions

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

A.   nullPayload

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 , but this value is not stored in the Object Store. The os:store operation stores testPayload, and the subsequent os:retrieve attempts to retrieve the value associated with #[testKey]. Since the stored value expires after 1 second, originalPayload is not returned. MuleSoft’s Object Store documentation specifies that retrieval returns the stored value only if it is still valid within the TTL.

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.

Salesforce-MuleSoft-Developer-II Practice-Test - Home
Page 2 out of 60 Pages