Run All Assertions Concurrently Assertion

The Run All Assertions Concurrently assertion is a folder that organizes one or more child assertions that must all evaluate to true. It is similar to the "All assertions must evaluate to true" composite assertion in that the assertion succeeds only when all the child assertions succeed. The major difference is that the Run All Assertions Concurrently assertion runs all its immediate child assertions concurrently, without waiting for earlier children to finish before beginning to evaluate subsequent children, helping reduce overall latency. This is useful when a response must be assembled from the results of a number of HTTP requests to various back-end services and you don't want all of the calls to be issued serially.
gateway83
The
Run All Assertions Concurrently
assertion is a folder that organizes one or more child assertions that must all evaluate to true. It is similar to the "All assertions must evaluate to true" composite assertion in that the assertion succeeds only when all the child assertions succeed. The major difference is that the Run All Assertions Concurrently assertion runs all its immediate child assertions concurrently, without waiting for earlier children to finish before beginning to evaluate subsequent children, helping reduce overall latency. This is useful when a response must be assembled from the results of a number of HTTP requests to various back-end services and you don't want all of the calls to be issued serially.
For more information about parent and child assertions in a policy, see Understanding Services and Policies on the Gateway.
The Run All Assertions Concurrently assertion will always succeed if there are no child assertions contained within it, or if all the child assertions have been disabled.
Technical Issues to Consider
The Run All Assertions Concurrently assertion must be used with care, as running many concurrent threads may cause issues that would not otherwise appear if the standard "All assertions..." folder is used. In particular, note the following:
  • Running assertions concurrently may cause the Gateway to run out of memory more quickly. The effect is similar to increasing the values for the
    io.httpMaxConcurrency
    and
    io.httpCoreConcurrency
    cluster properties.
  • Messages larger than 200KB in size are not recommended.
  • When too many assertions are being processed concurrently, new concurrent assertions will be delayed.
  • If the number of assertions queued up to run concurrently exceeds the limit set in the
    concall.globalMaxConcurrency
    cluster property, there could be a large delay if there are slow jobs in the queue (for example, HTTP routing to a slow back-end web service). Should this occur, try the following:
    • reduce the number of concurrent assertions
    • increase the
      concall.globalMaxConcurrency
      cluster property
    • decrease the
      io.httpMaxConcurrency
      cluster property
  • Unlike the "All assertions..." folder where processing stops at the first child assertion that fails, the Run All Assertions Concurrently assertion evaluates all child assertions, even those below one that fails. When a failure occurs, the assertion status code returned is for the first child assertion that failed.
  • Only context variables of type String or Message that are used by a child assertion will be available when a child assertion is executing.
  • The original request and response message, including any transport-specific message, will be unavailable unless they were copied into String variables before concurrent execution or copied as Message variables using the Set Context Variable assertion, with a source expression similar to
    ${request.mainpart}
    .
  • If an assertion inside a Run All Assertions Concurrently assertion writes to the default request or response, that information is ignored and lost.
  • Gathered credentials and authenticated user information is not available during concurrent execution.
  • A Run All Assertions Concurrently assertion may be nested within another Run All Assertions Concurrently assertion, but this will cause the
    API Gateway
    to run out of concurrency more quickly.
Configuring the Assertion
You can configure the concurrency behaviour using these cluster properties:
concall.globalMaxConcurrency
concall.globalCoreConcurrency
concall.globalMaxWorkQueue
For more information, see Input/Output Settings in Cluster Properties .
Using the Assertion
  1. Do one of the following:
    • To add the assertion to the policy development window, see Add an Assertion. 
    • To change the configuration of an existing assertion, proceed to step 2 below
  2. Populate the folder with child assertions using any of the following methods:
  3. Add an assertion by dragging and dropping if from policy window or the [
    Assertions
    ] tab.
  4. Remove an assertion by dragging and dropping it back into the policy window or by deleting the assertion.