Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Oracle Service Bus 11g Development Cookbook

You're reading from  Oracle Service Bus 11g Development Cookbook

Product type Book
Published in Jan 2012
Publisher Packt
ISBN-13 9781849684446
Pages 522 pages
Edition 1st Edition
Languages

Table of Contents (19) Chapters

Oracle Service Bus 11g Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Creating a basic OSB service Working Efficiently with OSB Artifacts in Eclipse OEPE Messaging with JMS Transport Using EJB and JEJB transport Using HTTP Transport Using File and Email Transports Communicating with the Database Communicating with SOA Suite Communication, Flow Control, and Message Processing Reliable Communication with the OSB Handling Message-level Security Requirements Handling Transport-level Security Requirements Index

Chapter 10. Reliable Communication with the OSB

In this chapter, we will cover the following topics:

  • Configuring Retry handling in JMS

  • Enabling JMS Message Persistence

  • Working with global transactions and Quality of Service

  • Using Reliable Messaging (WS-RM) with WS transport

  • Sending SOAP over JMS

Introduction


The consequence of not thinking about reliable communication or not implementing it in our OSB services can lead to many problems in case of error. It can lead to the loss of your messages, a destination can receive multiple messages and this means that the sending application can't trust the service bus. The application needs to monitor its own requests.

Reliable communication is all about Distributed Transactions—XA, Quality of Service (QoS), and persistence.

XA is a transaction that can be shared across multiple resources such as a JMS queue, coherence, direct binding, JCA binding, or an EJB session bean. Be aware that the HTTP transport does not support XA and can't take part in the so called global transaction. When an OSB transport or a JCA adapter starts a transaction, this transaction will be handled or controlled by the Java Transaction API (JTA) of the WebLogic server. XA will use a two-phase commit so all resources either do a commit or a rollback together.

When a destination...

Configuring Retry handling in JMS


In this recipe we will configure the redelivery limit and expiration policy on a Queue that will take part in a reliable communication. This option prevents an infinite loop: when the redelivery limit is reached, the message will be moved to the error queue. The redelivery limit on the queue will always override the value set on the message itself.

Getting ready

For this recipe we need the two queues from the standard environment and a proxy service that consumes the messages from the SourceQueue. The proxy service will initially just log the content of the message to the console using a Log action.

Import the OSB project into Eclipse from \chapter-10\getting-ready\configuring-retry-handling and deploy it to the OSB server. In the WebLogic console, perform the following steps to send a message to the queue for testing:

  1. Select Services | Messaging.

  2. Click on JMS Modules and in the list of modules click on OsbCookbookResources.

  3. Click on the SourceQueue queue.

  4. Navigate...

Enabling JMS message persistence


When we send messages to a JMS queue, the Message Delivery Mode option controls if a message is guaranteed to be delivered once, and if it is safely stored in the persistent store of the JMS server. There is also a non persistent option, where the messages are stored in memory and may be lost in case of a WebLogic or JMS server failure, or when the WebLogic server is rebooted.

In this recipe, we will set the delivery mode option on a JMS message with the OSB Transport Header action.

Getting ready

For this recipe, we will use a simple OSB project with one proxy and one business service:

You can import the OSB project into Eclipse from \chapter-10\getting-ready\enabling-jms-message-persistence.

How to do it...

In OPEP, perform the following steps:

  1. Navigate to the proxy service Request.

  2. Navigate to the Message Flow tab.

  3. Drag a Transport Header action and drop it on the Request action lane of the Route action.

  4. On the Properties tab of the Transport Header select Outbound...

Working with global transactions and quality of service


This recipe will show the different error scenarios, which we can have with XA and non XA enabled resources and how QoS can influence this.

Getting ready

For this recipe, we will use a setup with three queues from the standard environment, a proxy service that consumes messages from a JMS queue, and a business service that sends th messages to another JMS queue:

You can import the OSB project into Eclipse from \chapter-10\getting-ready\working-with-global-transactions-and-qos.

How to do it...

First, we will show you the behaviour of the service without a global transaction.

In Eclipse OEPE, perform the following steps:

  1. Navigate to the proxy service JMSConsumer.

  2. Navigate to the Transport tab.

  3. Change the Endpoint URI to use the non-XA JMS Connection Factory : jms://[OSBServer]:[Port]/weblogic.jms.ConnectionFactory/jms.SourceQueue

  4. Navigate to the Message Flow tab.

  5. The message flow contains a Pipeline Pair node and a Route node with a Routing action...

Using WS-Reliable Messaging (WS-RM) with WS transport


In this recipe, we will create a one-way (fire and forget) proxy service that contains a long running WS-RM (Reliable Messagng) policy and test this WS-RM policy in a JDeveloper web service proxy client.

We will use the WS transport, which implements both inbound and outbound requests for SOAP-based services with a WS-RM policy.

Getting ready

For this recipe, we will use a setup with a very simple proxy service based on a WSDL containing only a one-way operation. For the WS-RM client we will use JDeveloper.

You can import the OSB project into Eclipse from \chapter-10\getting-ready\using-reliable-msg-with-ws-transport.

How to do it...

First, let's change the proxy service to use the WS transport and add the reliable messaging policy. In Eclipse OEPE, perform the following steps:

  1. Open the Provider proxy service and navigate to the Transport tab.

  2. Select ws in the Protocol field to specify the WS transport.

  3. Navigate to the Policy tab.

  4. Select the...

SOAP over JMS


In this recipe, we will implement reliable SOAP communication over JMS and not over HTTP. The only difference is that your request and response will be published on a queue. This way the request can't be lost (when it has JMS persistence with XA/QoS). The response will also be published on the queue and the client can consume this response.

Getting ready

For this recipe, we will use an OSB project with a proxy service that is based on a WSDL with a synchronous request/response operation. The SOAP message will be sent over JMS instead of HTTP. JDeveloper will be used to generate a test client:

You can import the OSB project into Eclipse OEPE from \chapter-10\getting-ready\sending-soap-over-jms.

How to do it...

First we will need to change the proxy service to use the JMS instead of the HTTP transport. In Eclipse OEPE, perform the following steps:

  1. Open the SoapOverJMS proxy service.

  2. Click on the Transport tab.

  3. Choose jms in the Protocol field.

  4. The Endpoint URI must use a XA Connection...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Oracle Service Bus 11g Development Cookbook
Published in: Jan 2012 Publisher: Packt ISBN-13: 9781849684446
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}