This discussion is archived
1 Reply Latest reply: Apr 25, 2012 5:43 AM by 925144 RSS

Explicit capture --- ORA-24033 no recipients for message

925144 Newbie
Currently Being Moderated
Hello! I've set up a simple replication of a table between two databases and it works nicely. Now I want to study explicit capture with minimal changes done to the existing configuration.

That is basically I want to form a DML LCR and enqueue it to the source queue to be propagated then by the propagation process and applied by the apply process.

To make things simple, I wrote a procedure which takes an XMLType, converts it to the appropriate ANYDATA and queues it:
create or replace procedure
  enqueue_lcr_from_xml(p_xml in XMLType, p_queue_name in Varchar2) is
  v_lcr_any SYS.ANYDATA;
begin
  v_lcr_any := dbms_streams.convert_xml_to_lcr(p_xml);
  
  dbms_streams_messaging.enqueue(
    queue_name  =>  p_queue_name,
    payload     =>  v_lcr_any);
end enqueue_lcr_from_xml;
The queue was created previously as:
begin dbms_streams_adm.set_up_queue(
   queue_table => 'gr_streams_queue_table',
   queue_name  => 'gr_streams_queue');
end;
However I have a problem with enqueuing:
ORA-24033 no recipients for message
As far as I understood I need to use dbms_aq.enqueue instead of dbms_streams_messaging.enqueue to point the recipients. End here is a couple of questions:

What are the current recipients for each queue? How do I look for them? Are those the propagation process for the source queue and the apply process for the target?

How do I specify a recipient?
  • 1. Re: Explicit capture --- ORA-24033 no recipients for message
    925144 Newbie
    Currently Being Moderated
    I've made
    create or replace procedure
      enqueue_lcr_from_xml(p_xml in XMLType, p_queue_name in Varchar2)
    is
      v_lcr_any SYS.ANYDATA;
      enqueue_options     DBMS_AQ.enqueue_options_t;
      message_properties  DBMS_AQ.message_properties_t;
      recipients          DBMS_AQ.aq$_recipient_list_t;
      message_handle      RAW(16);
    begin
      v_lcr_any := dbms_streams.convert_xml_to_lcr(p_xml);
    
      enqueue_options.visibility := DBMS_AQ.IMMEDIATE;
      
      recipients(1) := sys.aq$_agent('GR_APPLY_STREAM', NULL, 0);
      message_properties.recipient_list := recipients;
    
      message_properties.sender_id := sys.aq$_agent(user, null, null);
      message_properties.delivery_mode := DBMS_AQ.BUFFERED;
    
      dbms_aq.enqueue(
       queue_name         => p_queue_name,
       enqueue_options    => enqueue_options,
       message_properties => message_properties,
       payload            => v_lcr_any,
       msgid              => message_handle);
    end enqueue_lcr_from_xml;
    But the messages are not applied by the apply process. Moreover, it seems they are not being enqueued, cnum_msgs in v$buffered_queues does not change when I run the procedure.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points