In our last article, Integrating Oracle BRM with enterprise applications, we explained one way of implementing a BRM-to-CRM integration. The suggested solution was to build a connector on the BRM side and have it connect to a third-party application. However, it is also possible to take a different approach by using Oracle Advanced Queuing, which will be the subject of this article.
Recently, we’ve been involved in a project where the customer wanted a “safe” integration without the need of being real-time; a near real-time solution would suffice, they said. What we mean by safe integration is having a solution that will not affect any action performed, such as purchasing a product or bill creation, by a failing communication link (or any other error) between Oracle BRM and third-party software. When implementing a custom dm connector for data integration, any unsuccessfully completed operation will rollback the entire action. While this can be a desired behavior, in this case it wasn’t; therefore, we decided to go with Oracle Advanced Queuing. We’ve identified that our worst case scenario here would be database issues, but there would also be numerous other problems as well; to begin with, the BRM system would not function properly.
Other advantages we’ve identified were data persistency (events are stored in the database until the consumer application is ready to process queued messages) and an already proven Oracle AQ technology.
We’ve successfully deployed these changes to Oracle BRM version 7.3 and 7.3.1 with Oracle Database 10g (10.2.0.1.0 64bit) and 11g (184.108.40.206.0 64bit) with the Oracle Advanced Queuing (AQ) component.
The process of publishing Oracle BRM business events using Oracle Advanced Queuing works can be seen on the figure below:
To develop such a synchronization process, it is necessary to take some preliminary steps. These include:
1. EAI Manager Installation.
o EAI Connection Manager (CM) module (includes op-codes required by EAI),
o EAI Data Manager,
o Payload Generator External Module (EM) – also called EAI Java Server or eai_js.
2. After completing the EAI Manager installation, configure values in the CM and EAI DM configuration files (pin.conf), as well as the Payload Generator properties file (Infranet.properties).
3. Configure the event notification list you wish to publish by editing the configuration files for event notification ($BRM_HOME/sys/data/config/pin_notify* files) and merge them before running the load_pin_notify utility.
4. Define business events in the Payload Generator EM configuration file (payloadconfig.xml).
After the preliminary steps have been completed, it’s time to create and configure the Oracle Advanced Queue. Here are the steps (the third step may vary, as it depends on your setup):
1. Create queue:
pin_ifw_sync_oracle.pl create -l $USER/$PASS@$DB -q TEST_QUEUE -t TEST_QUEUE
2. Test queue (optional step):
pin_ifw_sync_oracle.pl test -l $USER/$PASS@$DB -q TEST_QUEUE
3. Log in to your database as SYSTEM user and set appropriate grant privileges for your ‘t_user’:
exec dbms_aqadm.grant_queue_privilege(‘ALL’, ‘PUSER.TEST_QUEUE’, ‘t_user’);
grant execute on puser.pin_event_ty to t_user;
grant execute on sys.dbms_aqin to t_user;
Next, we need a queue producer, an application which is going to enqueue the business events defined earlier. Developing a producer module is similar to building your custom connector application (see here.) It is necessary to implement a custom module (library) and define it in the dm_eai configuration file under the “plugin_name” entry.
There’s also a simpler way to go about this task. If you’ve already installed “Account Synchronization DM,” then you will find an implementation of a queue producer module under dm_ifw_sync data manager. However, if you choose this option, some additional entries are required in the dm_eai configuration file.
After you have a working queue producer. go ahead and invoke some of your business events to see if they get queued. Queues can be queried in the table defined on queue creation.
Finally, you will need a queue consumer, an application that will read and dequeue your queued messages. There are several programmatic interfaces available for accessing Oracle Streams AQ in the following programming languages: Java (JMS), PL/SQL, C (OCI), Visual Basic (OO4O), AQ XML Servlet (IDAP).
With your custom client implementation, you will have full control at how fast, when, and how many messages are going to be processed. For instance, during off-peak hours, you can process more data than during peak hours.
Hopefully, we’ve given you some valid pointers on how to go about the process of integration/synchronization between Oracle BRM and third-party systems and/or applications.