Pages

Tuesday, February 5, 2008

Make the internal 10.1.3 ESB jms queues persistent

Standard are the internal esb queues jms memory queues. This is perfect for normal use but if you want to make an oracle esb cluster or make your own esb error handling then you can better make the esb queues database persistent. In this blog I will explain what to do.
I installed the 10.1.3.1 soa suite and upgrade this to 10.1.3.3. Then I apply patch 10.1.3.3.1. (patchset 6492514). You have to apply this patch if you want to use the esb_error queue.
First step is to update parameters of the esb repository so it uses the new jms database queues. Login with sqlplus to the oraesb schema and run the following script

delete esb_parameter where param_name = 'PROP_NAME_DEFERRED_TOPIC_JNDI';
delete esb_parameter where param_name = 'PROP_NAME_INITIAL_CONTEXT_FACTORY';
delete esb_parameter where param_name = 'ACT_ID_RANGE';
insert into esb_parameter values('PROP_NAME_DEFERRED_TOPIC_JNDI','ESBTopics/Topics/ESB_JAVA_DEFERRED');
insert into esb_parameter values('PROP_NAME_INITIAL_CONTEXT_FACTORY', 'com.evermind.server.rmi.RMIInitialContextFactory');
insert into esb_parameter values('ACT_ID_RANGE', '400');
update esb_parameter set param_value ='OracleOJMS/TCF' where param_name = 'PROP_NAME_DEFERRED_TCF_JNDI';
update esb_parameter set param_value ='OracleOJMS/XATCF' where param_name = 'PROP_NAME_DEFERRED_XATCF_JNDI';
update esb_parameter set param_value ='ESBTopics/Topics/ESB_CONTROL' where param_name = 'PROP_NAME_CONTROL_TOPIC_JNDI';
update esb_parameter set param_value ='OracleOJMS/XATCF' where param_name = 'PROP_NAME_CONTROL_TCF_JNDI';
update esb_parameter set param_value ='ESBTopics/Topics/ESB_ERROR' where param_name = 'PROP_NAME_ERROR_TOPIC_JNDI';
update esb_parameter set param_value ='OracleOJMS/TCF' where param_name = 'PROP_NAME_ERROR_TCF_JNDI';
update esb_parameter set param_value ='OracleOJMS/XATCF' where param_name = 'PROP_NAME_ERROR_XATCF_JNDI';
update esb_parameter set param_value ='ESBTopics/Topics/ESB_ERROR_RETRY' where param_name = 'PROP_NAME_ERROR_RETRY_JNDI';
update esb_parameter set param_value ='OracleOJMS/XATCF' where param_name = 'PROP_NAME_ERROR_RETRY_TCF_JNDI';
update esb_parameter set param_value ='ESBTopics/Topics/ESB_MONITOR' where param_name = 'PROP_NAME_MONITOR_TOPIC_JNDI';
update esb_parameter set param_value ='OracleOJMS/TCF' where param_name = 'PROP_NAME_MONITOR_TCF_JNDI';
update wf_agents set tcf_jndi='OracleOJMS/XATCF' where queue_type='DEFERRED';
update wf_agents set name ='ESBTopics/Topics/ESB_JAVA_DEFERRED' where queue_type='DEFERRED';
update wf_agents set queue_name ='ESBTopics/Topics/ESB_JAVA_DEFERRED' where queue_type='DEFERRED';
commit;
select * from esb_parameter;
select tcf_jndi, name, queue_type from wf_agents;

Make sure that you enable enqueue / dequeue on the esb queues

Second step we have configure the oc4j server
We have to make a new OracleOJMS resource provider
1. Go to the Administration tab, Enterprise Messaging Service, then Database Persistence.
2. On the Database Persistence configuration page, click Deploy.
The Deploy Database Persistence Provider screen appears.
3. Make the following entries and selections:
Resource Adapter Module Name: OracleOJMS
Select Add a new resource provider to be used by this connector
Resource Provider Name: esbRP
Datasource JNDI Location: jdbc/esbaqdatasource

restart the soa suite server

1. Click the default application, Now you see the adapter, click on the OracleOJMS Resource Adapter Module
2. Click Create to create a connection factory.
Select javax.jms.XATopicConnectionFactory from the Connection Factory and click Continue.
3. The Create Connection Factory screen appears.
In the JNDI Location field, enter OracleOJMS/XATCF. Click Finish.
4. Click Create to create a connection factory.
Select javax.jms.TopicConnectionFactory from the Connection Factory and click Continue.
5. The Create Connection Factory screen appears.
In the JNDI Location field, enter OracleOJMS/TCF. Click Finish.
6. Click the Administered Objects tab and click Create.
Select oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl and click Continue.
In the JNDI Location field, enter ESBTopics and in the resourceProviderName field enter esbRP
Now you can query the esb queue tables for errors.

9 comments:

  1. Hi!

    Thanks for an interesting post on this subject. I just did this and there is some confusion from the enterprise deployment guide, it says deploy this instance in the admin-OC4J! But I only have esbaq in my OC4J_SOA!

    ReplyDelete
  2. OC4J_SOA is the right one. In my case I have two oc4j container homes , 1 with the as control and 1 with bpel and esb.

    ReplyDelete
  3. Thanks a lot for your reply, OC4J_SOA was indeed the correct container, Oracles documentation was a bit misleading!

    ReplyDelete
  4. Hi, I followed your guide. How do you make sure that you enable enqueue / dequeue on the esb queues? ALso, I'm encountering Not support XA-backed sessions. I think I responded to your post on the Oracle Forums. Thanks.

    ReplyDelete
  5. Hi,
    have you some reference to official notes/guide?
    I try to find it on Metalink and Oracle site but no result.

    Thanks in advance

    ReplyDelete
  6. Hi, Here you have a pdf about this
    http://www.oracle.com/technology/products/integration/esb/files/esb-presentation-deployment.pdf

    I hope it helps

    ReplyDelete
  7. Hi ,
    After doing these changes our system hangs in every 5 hrs .Solution we do is always drop ESB_JAVA_DEFERRED queue and recreate it again.after taht system behaves normal.Do you have any clue why its doing like this.

    ReplyDelete
  8. Hi,

    please check the database. I think it is a database issue. Do you need to restart the database?

    and how many database sessions do you have.

    ReplyDelete
  9. Awesome man !! It worked like a charm. Looks like the ESB parameter files for that ESB subsystem were somehow missing the updates on the wf_agent table. We updated the necessary queue names and it worked. thanks !

    ReplyDelete