Oracle® Fusion Middleware Developer's Guide for Oracle SOA Suite 11g Release 1 (11.1.1) Part Number E10224-03 |
|
|
View PDF |
This chapter describes common message exchange patterns between an Oracle Mediator (Mediator) component and other applications.
This chapter includes the following sections:
Section 23.1, "Understanding One-way Message Exchange Pattern"
Section 23.2, "Understanding Request-Reply Message Exchange Pattern"
Section 23.3, "Understanding Request-Reply-Fault Message Exchange Pattern"
Section 23.4, "Understanding Request-Callback Message Exchange Pattern"
Section 23.5, "Understanding Request-Reply-Callback Message Exchange Pattern"
Section 23.6, "Understanding Request-Reply-Fault-Callback Message Exchange Pattern"
Note:
The following exchange patterns show the default handling of responses, faults, and callbacks by JDeveloper, when a routing rule is created. Keep in mind the following points for all the cases:When a response, fault, or callback is sent back to the caller, it is also possible to route the same to a different target service or event by clicking the button next to the target and selecting a different target.
When the caller of the Mediator expects a response, one or more routing rules may route the request to a target that does not return a response, but there should be at least one sequential routing rule that returns a response.
If you have multiple routing rules having request-response interaction, then the routing rules that send the response back to the initial caller, should precede other routing rules, if any, that forward the response.
The asynchronous request-reply pattern in Mediator is supported only for web services. This exchange pattern is not supported for Adapters and other services.
In a one-way interaction, the Mediator is invoked, but it does not send a response back to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-1:
Table 23-1 Response When Mediator's WSDL Is One-way
Routing Rule Target Type | Response |
---|---|
Request |
No response. |
Request Response |
Response is forwarded to another target or event. |
Request Response Fault |
Response and fault are forwarded to another target or event. |
Request Callback |
Callback is forwarded to another target or event. |
Request Response Callback |
Response and callback are forwarded to another target or event. |
Request Response Fault Callback |
Response, fault, and callback are forwarded to another target or event. |
Figure 23-1 illustrates one-way message exchange pattern.
Figure 23-1 One-way Message Exchange Pattern
In a request-reply interaction, the Mediator is invoked, and the Mediator sends a reply to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-2:
Table 23-2 Response When Mediator's WSDL Is Request Reply
Routing Rule Target Type | Response |
---|---|
Request |
No Response from the target, but there should be at least one sequential routing rule with request-response service. |
Request Response |
Response is sent back to the caller. Response can be forwarded to another target or event, but there should be at least one sequential routing rule that returns a response back to the caller. |
Request Response Fault |
Response is sent back to the caller. Fault is forwarded to another target or event. |
Request Callback |
No Response from the target, but there should be at least one sequential routing rule with request-response service. Callback is forwarded to another target or event. |
Request Response Callback |
Response is sent back to the caller. Callback is forwarded to another target or event. |
Request Response Fault Callback |
Response is sent back to the caller. Callback and fault are forwarded to another target or event. |
Figure 23-2 illustrates request-reply message exchange pattern.
Figure 23-2 Request-Reply Message Exchange Pattern
In a request-reply-fault interaction, the Mediator is invoked and the Mediator sends a reply and one or more faults back to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-3:
Table 23-3 Response When Mediator's WSDL Is Request Reply Fault
Routing Rule Target Type | Response |
---|---|
Request |
There should be at least one sequential routing rule with request-response-fault service. Mediator returns |
Request Response |
Response is sent back to the caller. Any exception in Mediator message processing may result in a fault. |
Request Response Fault |
Response and fault are sent back to the caller. Any exception in Mediator message processing may result in a fault. |
Request Callback |
No Response from the target, but there should be at least one sequential routing rule with request-response service. Mediator returns |
Request Response Callback |
Response is sent back to the caller. Any exception in Mediator message processing may result in a fault. |
Request Response Fault Callback |
Response and fault are sent back to the caller. Any exception in Mediator message processing may result in a fault. |
Figure 23-3 illustrates request-reply-fault message exchange pattern.
Figure 23-3 Request-Reply-Fault Message Exchange Pattern
In a request-callback interaction, the Mediator is invoked and the Mediator may send an asynchronous reply to the caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-4:
Table 23-4 Response When Mediator's WSDL Is Request Callback
WSDL of the Routing Rule Target | Response |
---|---|
Request |
There should be at least one sequential routing rule with request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Response |
Response is sent back to the caller, as callback, in a separate thread. |
Request Response Fault |
Response is sent back to the caller, as callback, in a separate thread. Fault is forwarded to another target or event. |
Request Callback |
Callback is sent back to the caller. |
Request Response Callback |
Callback is sent back to the caller, and response is forwarded to another target or event. |
Request Response Fault Callback |
Callback is sent back to the caller. Response and fault are forwarded to another target or event. |
Figure 23-4 illustrates request-callback message exchange pattern.
Figure 23-4 Request-Callback Message Exchange Pattern
In a request-reply-callback interaction, the Mediator is invoked and the Mediator sends a response and an asynchronous reply to the initial caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-5:
Table 23-5 Response When Mediator's WSDL Is Request Response Callback
Routing Rule Target Type | Response |
---|---|
Request |
There should be at least one sequential routing rule that returns a response. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Response |
There should be at least one sequential routing rule that returns a response. No callback is sent, if there is no routing rule with a defined callback. |
Request Response Fault |
There should be at least one sequential routing rule that returns a response. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Callback |
There should be at least one sequential routing rule that returns a response. Mediator returns |
Request Response Callback |
Response and callback are sent back to the caller. |
Request Response Fault Callback |
Response and callback are sent back to the caller. Fault is forwarded to another target or event. |
Figure 23-5 illustrates request-reply-callback message exchange pattern.
Figure 23-5 Request-Reply-Callback Message Exchange Pattern
In a request-reply-fault-callback interaction, the Mediator is invoked and the Mediator sends a response, an asynchronous reply, and one or more fault types to the initial caller. Depending on the type of routing rule target, the responses, faults, and callbacks are handled as shown in Table 23-6:
Table 23-6 Response to a Request Response Fault Callback Mediator
WSDL of the Routing Rule Target | Response |
---|---|
Request |
There should be at least one sequential routing rule with request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Response |
There should be at least one sequential routing rule with request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Response Fault |
There should be at least one sequential routing rule with request-callback service. No callback is sent to the caller if there is no routing rule with a defined callback. |
Request Callback |
There should be at least one sequential routing rule that returns a response. Mediator returns |
Request Response Callback |
Response and callback are sent back to the caller. Any exception in Mediator message processing may result in a fault. |
Request Response Fault Callback |
Response, fault, and callback are sent back to the caller. |
Figure 23-6 illustrates request-reply-fault-callback message exchange pattern.
Figure 23-6 Request-Reply-Fault-Callback Message Exchange Pattern