QuestionQ4

VerifiedDesigning integration solutions to meet performance requirements

A Mule solution implements an Experience API and a System API as Mule applications that process messages in this sequence:

  1. The Experience API receives an Anypoint MQ request message (REQU) whose payload contains a variable-length list of request objects.
  2. The Experience API uses a For Each scope to split the list into individual objects and sends each object as a REQU_OBJECT message to an Anypoint MQ queue named REQUEST.
  3. The System API listens on the REQUEST queue, processes each message independently of every other message, and sends a response message to a response queue named RESPONSE_OBJECT. System API processing times can vary and are occasionally fairly long.
  4. The Experience API listens on the RESPONSE_OBJECT queue and receives, transforms, and accumulates every response.
  5. After it receives all responses corresponding to the original REQU message, the Experience API creates and publishes a response Anypoint MQ message (RESP) to an Anypoint MQ queue named RESPONSE. Its payload contains the list of responses returned by the System API, organized in the same order as the request objects originally sent in the REQU message.

Assume that successful response messages are returned by the Experience API to the RESPONSE queue for all REQU messages.

What is required for the Experience API to ensure that the object-list length and order in RESP match those in REQU, while also maximizing message throughput?

Explanation

Independent asynchronous processing with variable durations does not preserve the original request order. Persisting the expected request count and each request’s original index allows the Experience API to correlate returned objects to the correct REQU message, detect when the complete set has arrived, and assemble RESP by index rather than arrival order. A persistent object store retains this aggregation state across separate messages and flow invocations. Processing more than one received response concurrently increases throughput; Mule’s maxConcurrency controls the number of concurrent messages a flow can process.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!