IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Enterprise Service Bus programming > Invocation of Services > Service invocation styles

Synchronous invocation

When a service component is called synchronously, or performs a synchronous invocation, both the service requester and the service provider run in the same thread of execution (a thread of execution is defined as the smallest unit that can be scheduled in an operating system). The calling component within WebSphere ESB is blocked until a response is received from the provider.

Once the service provider has been called, all processing is suspended until the thread returns a response. This is shown in Figure 1.

Synchronous SCA invocation is useful if the service requester depends upon receiving a response from the service before continuing its processing.

Figure 1. Synchronous SCA invocation


Example scenario

Jane wants to transfer money through online banking, to Stephen's bank account. The bank must ensure that Jane's account is debited, and Stephen's account is credited. Both of the actions must be completed, and if one of the actions fail then neither of them must occur. If Jane's bank account is debited, and Stephen's bank account fails to be credited, a rollback action must occur to credit Jane's bank account, so that money is not lost at any point of the transaction. A confirmation message will only be sent to Jane if the transfer is successful.

Synchronous SCA invocation is an applicable style in this situation, because a message is sent to the service in one thread, and no processing is done by the service requester until the message returns for processing to continue in the same thread.

Service invocation styles