Tuesday, February 2, 2010

Rejection Message Handling

The "Rejected Message handlers" come in four different flavors. They must be defined as
part of the Activation Agent properties.
·  File system based Rejection Handler
<property name="rejectedMessageHandlers">
file://<directory-path>
</property>
for example
<property name="rejectedMessageHandlers">
file://C:/orabpel/domains/default/rejectedMessages
</property>
This rejection handler is straight forward and the bad messages are written to the
configured directory using the file name pattern
INVALID_MSG_ + <process-name> + <operation-name> + <current-time>

·  RAW Oracle Advanced Queue based Rejection Handler
<property name="rejectedMessageHandlers">
queue://jdbc:oracle:thin:@<db-host>:<tns-port>:<sid>|<user>/<password>|<queue-name>
</property>
The <password> can be encrypted. For example
<property name="rejectedMessageHandlers">
queue://jdbc:oracle:thin:@acme-sun:1521:ORCL|scott/tiger|JCA_BAD_MESSAGES
</property>
This rejection handler allows the user to designate a Oracle Rdbms RAW AQ queue
as the rejection storage. Note that the ":" and "|" must appear in the places shown.
Also note that the password can be encrypted using the encrypt.bat utility in
orabpel/bin.
·  BPEL Process Rejection Handler
<property name="rejectedMessageHandlers">
bpel://<bpel-domain[:<password>]>|<process-name>|<operation-name>|<input-message-partname>
</property>
The <password> for the BPEL domain can be encrypted - "[]" means that the
property is optional. For example
<property name="rejectedMessageHandlers">
bpel://default|JCA-RejectionHandler|handleRejection|message
</property>
This rejection handler will send the bad message to another (designated error
handling) BPEL process. The user can thus define a process with a Receive operation
of his own choosing (WSDL and BPEL src) - the only constraint is on the Message
Type of the message that will be sent to this rejection handler. It must be declared to
have the type "RejectedMessage". This can conveniently be achieved by importing
the "xmllib" resident WSDL "RejectionMessage.wsdl" which defines such a message:
<message name="RejectionMessage">
<part name="message" element="err:RejectedMessage"/>
</message>
An xmllib WSDL import (from another WSDL) is achieved using the "well-known"
URL
<import namespace="http://xmlns.oracle.com/pcbpel/rejectionHandler"
location="http://localhost:9700/orabpel/xmllib/jca/RejectionMessage.wsdl"/>
i.e. the Receive operation WSDL which the user defines for his Rejection Handler BPEL Process would simply contain this import and then the port type would
reference this:
<definitions ...
xmlns:rej="http://xmlns.oracle.com/pcbpel/rejectionHandler"
<portType name="MyRejectionHandlerPortType">
<operation name="myHandleRejectionOperation">
<input message="rej:RejectionMessage"/>
</operation>
</portType>
·  WSIF Based Rejection Handler
<property name="rejectedMessageHandlers">
wsif://<wsif-wsdl-location>|<operation-name>|<input-message-part-name>
</property>
For example
<property name="rejectedMessageHandlers">
wsif://file:/C:/orabpel/samples/test/ErrorTest/FileAdapterWrite.wsdl|write|message
</property>
This last rejection handler lets the user configure any type of WSIF WSDL (JCA, EJB,
JMS, HTTP, Java etc), i.e. any kind of Service which can be reached via WSIF - as
the bad message handler. The exact same constraint vis-a-vis the Message Type as
described above for the BPEL Process Rejection Handler also applies here.

Notes: (1) BPEL supports all four types of rejection handlers

(2) ESB supports only 3 types of rejection handlers except the BPEL based rejection handler ( Until Soa Suite 10.1.3.5) .

The following examples demostrate how rejectionmessageHandler can be defined in ESB

(a) ESB AQ rejected Message Handler:

queue://jdbc:oracle:thin:@localhost:1521:XE|jmsuser/jmsuser|ESB_REJ_MSG_TOPIC


(b) ESB BPEL rejected Message Handler:

bpel://default|CaptureRejectedMessage|process|message


(c) ESB WSIF based rejection handler:
wsif://http://localhost:8888/orabpel/default/CaptureRejectedMessage/1.0/CaptureRejectedMessage?wsdl|handleRejection|message

No comments: