Interaction Patterns in a BPEL Process
This describes common interaction patterns between a BPEL process service component and an external service:
Interaction patterns:
One-Way Messages:
In a one-way message, or fire and forget, the client sends a message to the service and the service is not required to reply.
Synchronous Interactions:
In a synchronous interaction, a client sends a request to a service and receives an immediate reply. For example, a user requests a subscription to an online newspaper and immediately receives email confirmation that their request has been accepted.
Asynchronous Interactions:
In an asynchronous interaction, a client sends a request to a service and waits until the service replies.
Asynchronous Interactions with a Timeout:
In an asynchronous interaction with a timeout (which you perform in BPEL with a pick activity), a client sends a request to a service and waits until it receives a reply, or until a certain time limit is reached, whichever comes first. For example, a client requests a loan offer. If the client does not receive a loan offer reply within a specified amount of time, the request is canceled.
Asynchronous Interactions with a Notification Timer:
In an asynchronous interaction with a notification time, a client sends a request to a service and waits for a reply, although a notification is sent after a timer expires. The client continues to wait for the reply from the service even after the timer has expired.
One Request, Multiple Responses:
In this interaction type, the client sends a single request to a service and receives multiple responses in return. For example, the request can be to order a product online, and the first response can be the estimated delivery time, the second response a payment confirmation, and the third response a notification that the product has shipped.
One Request, One of Two Possible Responses:
In an interaction using one request and one of two possible responses, the client sends a single request to a service and receives one of two possible responses. For example, the request can be to order a product online, and the first response can be either an in-stock message or an out-of-stock message.
One Request, a Mandatory Response, and an Optional Response:
In this type of interaction, the client sends a single request to a service and receives one or two responses. Here, the request is to order a product online. If the product is delayed, the service sends a message letting the customer know. In any case, the service always sends a notification when the item ships.
Partial Processing:
In partial processing, the client sends a request to a service and receives an immediate response, but processing continues on the service side. For example, the client sends a request to purchase a vacation package, and the service sends an immediate reply confirming the purchase, then continues on to book the hotel, the flight, the rental car, and so on. This pattern can also include multiple shot callbacks, followed by longer-term processing.
Multiple Application Interactions:
In some cases, there are more than two applications involved in a transaction, for example, a buyer, seller, and shipper. In this case, the buyer sends a request to the seller, the seller sends a request to the shipper, and the shipper sends a notification to the buyer. This A-to-B-to-C-to-A transaction pattern can handle many transactions at the same time. Therefore, a mechanism is required for keeping track of which message goes where.
This describes common interaction patterns between a BPEL process service component and an external service:
Interaction patterns:
- One-Way Messages
- Synchronous Interactions
- Asynchronous Interactions
- Asynchronous Interactions with a Timeout
- Asynchronous Interactions with a Notification Timer
- One Request, Multiple Responses
- One Request, One of Two Possible Responses
- One Request, a Mandatory Response, and an Optional Response
- Partial Processing
- Multiple Application Interactions
One-Way Messages:
In a one-way message, or fire and forget, the client sends a message to the service and the service is not required to reply.
Synchronous Interactions:
In a synchronous interaction, a client sends a request to a service and receives an immediate reply. For example, a user requests a subscription to an online newspaper and immediately receives email confirmation that their request has been accepted.
Asynchronous Interactions:
In an asynchronous interaction, a client sends a request to a service and waits until the service replies.
Asynchronous Interactions with a Timeout:
In an asynchronous interaction with a timeout (which you perform in BPEL with a pick activity), a client sends a request to a service and waits until it receives a reply, or until a certain time limit is reached, whichever comes first. For example, a client requests a loan offer. If the client does not receive a loan offer reply within a specified amount of time, the request is canceled.
Asynchronous Interactions with a Notification Timer:
In an asynchronous interaction with a notification time, a client sends a request to a service and waits for a reply, although a notification is sent after a timer expires. The client continues to wait for the reply from the service even after the timer has expired.
One Request, Multiple Responses:
In this interaction type, the client sends a single request to a service and receives multiple responses in return. For example, the request can be to order a product online, and the first response can be the estimated delivery time, the second response a payment confirmation, and the third response a notification that the product has shipped.
One Request, One of Two Possible Responses:
In an interaction using one request and one of two possible responses, the client sends a single request to a service and receives one of two possible responses. For example, the request can be to order a product online, and the first response can be either an in-stock message or an out-of-stock message.
One Request, a Mandatory Response, and an Optional Response:
In this type of interaction, the client sends a single request to a service and receives one or two responses. Here, the request is to order a product online. If the product is delayed, the service sends a message letting the customer know. In any case, the service always sends a notification when the item ships.
Partial Processing:
In partial processing, the client sends a request to a service and receives an immediate response, but processing continues on the service side. For example, the client sends a request to purchase a vacation package, and the service sends an immediate reply confirming the purchase, then continues on to book the hotel, the flight, the rental car, and so on. This pattern can also include multiple shot callbacks, followed by longer-term processing.
Multiple Application Interactions:
In some cases, there are more than two applications involved in a transaction, for example, a buyer, seller, and shipper. In this case, the buyer sends a request to the seller, the seller sends a request to the shipper, and the shipper sends a notification to the buyer. This A-to-B-to-C-to-A transaction pattern can handle many transactions at the same time. Therefore, a mechanism is required for keeping track of which message goes where.
No comments:
Post a Comment