Saturday, July 11, 2015

Web Services Reliable Messaging (WSRM) in OSB

It can be achieved using WS transport protocol for the proxy/biz services, which will allow messages to be delivered reliably between distributed systems even if system, network failure occurs.

This is basically used for the wsdl + wsrm policy based communication. RM policy can be be the part of wsdl or attached separately using policy tab in proxy/biz service. If policy is not there either way, then error will be thrown.

Please note that policy without RM assertion also be errored. Policy used by other transport must not have RM assertions and we must use only one RM assertion for a WS-policy.

Below is the tags for RM assertion :



Quality of Service (QoS) will be always Exactly once for the proxy service based on the ws transport. We can set QoS using the tag  in RM policy. It can contain any of the below:

  • AtMostOnce
  • AtLeastOnce
  • Exactly Once
  • OnOrder

Saturday, July 4, 2015

OSB as Reliable Communication

How to make our OSB communication reliable ?? else it leads to loss of message or duplicate message reaching at destination.

Basically, there are two aspects which help us in reliable communication with OSB

  • XA DataSource for transaction
  • QoS (Quality of Service)
Before have a deep dive into these, we understand about Global Transaction in general. In a single global transaction, any fault within the osb service or composite will result in a complete rollback of all transactions. But important is, only systems which are part of global transaction will be rolled back. and So called Global Transaction.
On the other hand, if it is not global transaction and fault occurs in specific part say RouteNode and handled, then only that local transaction in RouteNode will be rollback, not other invocation in message flow. So we should be in Global Transaction if we want to make reliable Communication.

XA is the transaction which can be shared with multiple resources as JMS, JCA, direct binding. Although using messaging queue is always reliable as we can enable persistence but it is more nice if we use it using xa data source which will create global transaction. XA will use two phase commit so all resource either do a commit or a rollback together.

Using QoS we can control message flow to destination if it is a global transaction. There are two concepts here
  • exactly once: it is for reliability through message assurance, will deliver message only once if destination is the part of global transaction
  • best effort: if destination is not the part of global transaction then message can be delivered more than once if OSB process is retried.
If the sending and receiving application can detect failure/duplicate messaging then reliable communication might not be necessary.

We will see on WSRM (Web Service Reliable Messaging) specification describes a protocol (WS) for Reliable Communication, in my next blog