()()OSB provides logic for bridging services over different transport protocols. In this example we will demonstrate how to expose a Service(back-end-JMS Protocol ) as Service (front-end-HTTP Protocol) . Any service exposed over HTTP is inherently non-transactional and can be synchronous. On the other hand service exposed over JMS is asynchronous and can be transactional. In short we are bridging a asynchronous ,transactional service with synchronous, non -transactional service
HTTP Request------JMS Request ---------Some routing Logic -------JMS Response-------HTTP Response.
To demonstrate this we create JMSProxyService with following configuration
Protocol =jms
Endpoint URI =jms://localhost:7001/weblogic.jms.XAConnectionFactory/Back-endServiceRequest
Get All Headers =Yes
Is Response Required =Enabled
Response Correlation Pattern=JMSCorrelationID
Response URI =jms://localhost:7001/weblogic.jms.XAConnectionFactory/Back-endServiceResponse
Is XA Required =true
It should be noted that 'Get All Headers' and 'Response Correlation Pattern' play important role in case of failure. which will be shortly later.In the pipeline logic for the Proxy we will use Servicecallouts. Servicecallouts by default are at Best-Effort as are the Publishactions. If you would like our Servicecallout to participate in Global Transaction (XA), we have to change the QOS of the Servicecallouts/Publishactions to Exactly-Once. It should how ever be noted that these semantics should be supported by the specific transport. eg. JMS transport can support Exactly-Once where as HTTP transport will not support Exactly-Once. If the transport doesn't support the semantic, it will be automatically down graded to the lowest possible semantic support. So even if we change the semantic of HTTP transport to Exactly-Once, OSB will only provide Best-Effort.
So we create BS JMSProxyWrapper
| Protocol | =jms |
| Endpoint URI | =jms://localhost:7001/weblogic.jms.XAConnectionFactory/Back-endServiceRequest |
| Is Response Required | =Enabled |
| Response Correlation Pattern | =JMSCorrelationID |
| Response URI | =jms://localhost:7001/weblogic.jms.XAConnectionFactory/Back-endServiceResponse |
Please note that the requests and the response JMS Q for the JMSProxyService and JMSProxyWrapper are the same .
JMSProxyWrapper(BS)----->Back-endServiceRequest(JMSQ)-------->JMSProxyService(PS-Start)--->-----
\ some outing logic/publish/servicecallouy
\
JMSProxyWrapper(BS)<-----Back-endServiceResponse(JMSQ)<-------JMSProxyService(PS-End)-----<----
Now we create the front-end (HTTP Proxy) and in the route node is configured to route to JMSProxyWrapper
So the over all flow is
front-End(HTTP-PS)-------->Routes------->JMSProxyWrapper(JMS-BS)---->JMSProxy(JMS-PS)
<-------- <------- <------- (Response path)