2 Replies Latest reply: Jan 21, 2013 5:18 AM by 985490 RSS

    Getting Queueing event from PL/SQL to C++ OCI code

    985490
      Hi All,
      I am a new member to the forum as well as started programming in OCI with Oracle AQ. I need a help to resolve my problem from this open forum. I have created a oracle AQ in Db and register a consumer name for the same. Now i will register the same consumer name from C/OCI to monitor the queue. Now if there is any message got inserted into the same queue, I should get a notification from the queue, so that based on that notification, OCI/C program can call a asynchronous callback from that event.

      1. Queue is created through PL/SQL
      2. Consumer is registered with PL/SQL
      3. C/OCI program is written to register the consumer.
      4. Now from PL/SQL, we will push the message in the queue.
      5. Based on the message enqueue, C/OCI program will get notification.(Like message queuing should notify that new message came to queue.)

      Is this possible, that any insertion of message in the queue will notify the C binary code. If yes, please provide me a bit more details on the same. Thanks in advance.

      Amartya
        • 1. Re: Getting Queueing event from PL/SQL to C++ OCI code
          jchristian
          982487 wrote:
          Hi All,
          I am a new member to the forum as well as started programming in OCI with Oracle AQ. I need a help to resolve my problem from this open forum. I have created a oracle AQ in Db and register a consumer name for the same. Now i will register the same consumer name from C/OCI to monitor the queue. Now if there is any message got inserted into the same queue, I should get a notification from the queue, so that based on that notification, OCI/C program can call a asynchronous callback from that event.

          1. Queue is created through PL/SQL
          2. Consumer is registered with PL/SQL
          3. C/OCI program is written to register the consumer.
          4. Now from PL/SQL, we will push the message in the queue.
          5. Based on the message enqueue, C/OCI program will get notification.(Like message queuing should notify that new message came to queue.)

          Is this possible, that any insertion of message in the queue will notify the C binary code. If yes, please provide me a bit more details on the same. Thanks in advance.

          Amartya
          Hi Amartya,

          It appears if you are using OCCI and C++, you can use Oracle's Listener object to check for queue events:
          http://docs.oracle.com/cd/B13789_01/appdev.101/b10778/queuing.htm#CHDGDGFI

          I don't see anything for OCI using C, though.

          If you have no luck with Oracle support, and cannot get a response from the forum, you may try:
          1. Using an infinite loop in the C program.
          2. Calling the provided pl/sql procedures via the OCI program to check and/or update the queue from C once processing has been completed. (http://docs.oracle.com/cd/E11882_01/appdev.112/e10646.pdf)

          Hope this helps.

          Edited by: jchristian on Jan 18, 2013 9:19 AM
          • 2. Re: Getting Queueing event from PL/SQL to C++ OCI code
            985490
            Hi Christian,
            Thanks for the information. Let me give a try with the OCI option first, then I will try with OCCI. Will update the thread.
            Thanks once again.

            Amartya