Friday, July 31, 2009

How To Use Setup A JMS Based Persistent Delivery System

The following steps can be used to setup a jms based persistent delivery system in Oracle Application Server 10.1.3.4 MLR #8.

The steps required can be classified into
a. DB Objects.
b. Resource Providers
c. JMS Consumer/Producer creation.

DB Objects:
We need to create the queue and the actual queue table that will be used as a persistent store. They can be created in any schema. The following commands are used:

DBMS_AQADM.CREATE_QUEUE_TABLE(Queue_table =>'Queue_Table',Queue_payload_type => 'SYS.AQ$_JMS_MESSAGE', sort_list => 'PRIORITY,ENQ_TIME', multiple_consumers=>false, compatible =>'8.1.5');

DBMS_AQADM.CREATE_QUEUE(Queue_name=>'Queue_Name', Queue_table=>'Queue_Table ',max_retries => 0);

*Replace Names in bold with required values.
Max Retries 0 – as of now only queues with retry_count zero go into the error queue.

Resource Providers:
We will have to modify two entities
a. ORACLE_AS_HOME/j2ee/oc4j_soa/config/application.xml:
Add another Resource Provider to the database containing the queues.

b. ORACLE_AS_HOME/j2ee/oc4j_soa/application-deployments/default/JmsAdapter/oc4j-ra.xml:
Add another connector factory.Make sure that the value in connectionFactoryLocation is of the form java:comp/resource/RA_NAME/XAQueueConnectionFactories/AIA_Queue
And acknowledgeMode is CLIENT_ACKNOWLEDGE and isTransacted is false.
RA_NAME: the name of the resource provider created in previous step.


c. JMS Producer/Consumer Creation:
Once the jms producer/consumers are created, the BPEL Processes that are invoked by the consumer must have the following configurations:
a. ”transaction” participate for every partnerlink and at project level setting.
b. “handleTopLevelFault” should be set to false only then the fault gets bubbled back to the consumer and the message is put back in the error queue.


ERROR QUEUE:
On doing the above steps you can see the errored msgs in the queue table but will be present with queue name as _error.

THROTTLE THE INBOUND MESSAGE FLOW:
We can also use this system to throttle the no of inbound messages that will be processed in the server.This is can be done by using a BPEL based JMS Consumer using the “minimumDelayBetweenMessages” activation agent property in bpel.xml.For e.g. Setting this property to 100ms will ensure a delay of 100ms between two consecutive messages posted to BPEL.

The Beginning is the end is the beginning

Hello World.
This blog tries to make programming around SOA with OracleAS 10.1.3.4 easier.Have you encountered situations where you are stuck in development for long periods and have absolutely no idea why something is not working?Well we've been there.We've been through that.With a series of blogposts,we try to make life easier for all SOA developers.Welcome Aboard.