Amarpreet Kaur asked 2 years ago
Title : How to create AQ connection between BRM and AIA.

Question :

How to create AQ connection between BRM and AIA.

1 Answers
ParwezParwez Staff answered 2 years ago

AIA and BRM intercation can be done via BRm JCa adapter, calling BRm webservices and using AQ adapters.

Oracle Streams Advanced Queuing (AQ) provides a flexible mechanism for bidirectional, asynchronous communication between participating applications. Advanced queues are an Oracle database feature, and are therefore scalable and reliable. Other features of Oracle database, such as backup and recovery (including any-point-in-time recovery), logging, transactional services, and system management, are also inherited by advanced queues. Multiple queues can also service a single application, partitioning messages in a variety of ways and providing another level of scalability through load balancing.

Database AQ table and queue creation : Here we will create required table queues

CONNECT sys/change_on_install as sysdba

DROP USER aq_user CASCADE;

CREATE USER aq_user IDENTIFIED BY aq_user
  DEFAULT TABLESPACE users
  TEMPORARY TABLESPACE temp;

ALTER USER aq_user QUOTA UNLIMITED ON users;

GRANT aq_administrator_role TO aq_user;
GRANT connect               TO aq_user;
GRANT create type           TO aq_user;
GRANT create sequence       TO aq_user;

EXECUTE dbms_aqadm.grant_type_access('aq_user');

-- Login as AQ_User
CONNECT aq_user/aq_user

CREATE TYPE message_type AS OBJECT (
    message_id     NUMBER(15)
  , subject        VARCHAR2(100)
  , text           VARCHAR2(100)
  , dollar_value   NUMBER(4,2)
)
/
BEGIN

   -- ----------------------------------------------------

    DBMS_AQADM.CREATE_QUEUE_TABLE (
        queue_table         => 'aq_user.msg_qt'
      , queue_payload_type  => 'aq_user.message_type'
    );

    -- ----------------------------------------------------

    DBMS_AQADM.CREATE_QUEUE (
        queue_name          => 'msg_queue'
      , queue_table         => 'aq_user.msg_qt'
      , queue_type          => DBMS_AQADM.NORMAL_QUEUE
      , max_retries         => 0
      , retry_delay         => 0
      , retention_time      => 1209600
      , dependency_tracking => FALSE
      , comment             => 'Test Object Type Queue'
      , auto_commit         => FALSE
    );

    -- ----------------------------------------------------

    DBMS_AQADM.START_QUEUE('msg_queue');

    -- ----------------------------------------------------

END;
/
--To Stop and Drop the Queue
CONNECT aq_user/aq_user

EXECUTE dbms_aqadm.stop_queue(queue_name => 'aq_user.msg_queue');
EXECUTE dbms_aqadm.drop_queue(queue_name => 'aq_user.msg_queue');
EXECUTE
dbms_aqadm.drop_queue_table(queue_table => 'aq_user.msg_qt');

DROP TYPE aq_user.message_type;

Weblogic configuring aq adapter in Weblogic:

  1. login to weblogic server and Create JDBC Datasource localhost-aq whose JNDI name is jndi/localhost-aq
  2. Under Deployments select AQAdapter , Configurations Tab and Outbound Connection , Create a new Outbound Connection eis/aq/localhost-aq whose XADataSourceName is jndi/localhost-aq
  3. Provide connection details and deploy to the required target, admin or soa server.
  4. Update the AQAdapter Deployment , Update the plan , no restart needed.

Lets create a simple BPEL process my-aq-app , Under External Reference Insert AQ Adapter

To configure AQ adapter, follow the below steps.

  1. Open Jdeveloper and create a new project under soa application.
  2. Under external reference drag and drop a AQ Adapter.
  3. Provide service name and connection details in subsequent screens.
  4. JNDI name should match to the one that we configured in the Weblogic Console
  5. Select operation as Enqueue.
  6. Select the DB Schema as AQ_USER , click on Browse button and select MSG_QUEUE as Queue Name
  7. Select Object Payload as Whole MESSAGE_TYPE
  8. Save, Deploy and Test , You can see the Data being Written to Queue Table under AQ_USER.

Cubastion is among a very small number of specialized Siebel CRM Oracle Gold Partners in SME.