Synchronous input processing with synchronous result

Previous Next

In synchronous processing, the input is processed immediately when it arrives. If a response is needed, that response is sent directly as a result of the processing.

In this pattern, the same process that receives an event also handles the event, so a queue table is not strictly needed. It is, however, best practice to use a queue table in any case, even if only for traceability.

When to consider

This pattern is a good choice when:

Events have low frequency and can be processed one-by-one.

Processing the event does not require a lot of resources and does not take much time, or the necessary processing time is acceptable to the caller.

Events do not have to be processed in a specific order and an enterprise message bus is used to scale the workload.

Advantages

Easy to write and to understand.

Simple deployment procedure.

Simple to monitor in a production environment.

Disadvantages

Does not scale.

Is based on the request-response principle, so the caller has to wait for the response.

Is not ready to deal with unexpected event frequency.

Cannot guarantee the delivery of output events (this can be achieved by using an asynchronous result).

 

See also

Synchronous input processing with asynchronous result

Asynchronous input processing with synchronous result

Asynchronous input processing with asynchronous result

 

SD_clip0019