oraclejmsadvanced-queuing

Exception on creating a jms map message on the Oracle database


I'm trying to create and enqueue a JMS message of type map. But when doing so I receive the following error

ORA-29516: Aurora assertion failure: Assertion failure at eox.c:359
Uncaught exception Root of all Java exceptions: java.lang.UnsatisfiedLinkError sun.net.PortConfig.getLower0 
ORA-06512: at "SYS.DBMS_JMS_PLSQL", line 498
ORA-06512: at "SYS.AQ$_JMS_MAP_MESSAGE", line 79
ORA-06512: at line 20
29516. 00000 -  "Aurora assertion failure: %s"
*Cause:    An internal error occurred in the Aurora module.
*Action:   Contact Oracle Worldwide Support.

The SQL I'm using looks like this

DECLARE
  v_id                  pls_integer;
  v_msg                 sys.aq$_jms_map_message;
  v_msg_agent           sys.aq$_agent;
  v_msg_proparray       sys.aq$_jms_userproparray;
  v_msg_property        sys.aq$_jms_userproperty;
  v_msg_header          sys.aq$_jms_header;
  v_enqueue_options     dbms_aq.enqueue_options_t;
  v_msg_properties      dbms_aq.message_properties_t;
  v_msgid               raw(16);
BEGIN
  v_msg_agent := SYS.AQ$_AGENT(' ', NULL, 0);
  v_msg_proparray := SYS.AQ$_JMS_USERPROPARRAY();
  v_msg_proparray.EXTEND(1);
  v_msg_property := SYS.AQ$_JMS_USERPROPERTY('JMS_OracleDeliveryMode', 100, '2', NULL, 27);
  v_msg_proparray(1) := v_msg_property;
  v_msg_header := SYS.AQ$_JMS_HEADER(v_msg_agent,NULL,'<USERNAME>',NULL,NULL,NULL,v_msg_proparray);
  v_msg := sys.aq$_jms_map_message(v_msg_header,NULL,NULL,NULL);
  v_id := v_msg.clear_body(-1);

  v_msg.set_string(v_id, 'STRING', 'Test');

  v_msg.flush(v_id);
  v_msg.clean(v_id);
  dbms_aq.enqueue(queue_name => 'SEND_QUEUE',
                enqueue_options => v_enqueue_options,
                message_properties => v_msg_properties,
                payload => v_msg,
                msgid => v_msgid);
END;

The issue seems to be caused by the v_id := v_msg.clear_body(-1); call. I have no idea how fix this since the same configuration does work for the text message type. But that doesn't use the id parameter (So I don't need to call clear_body).

v_msg := sys.aq$_jms_text_message(v_msg_header,NULL,NULL,NULL);
v_msg.text_vc  := 'test';
v_msg.text_len := LENGTH(v_msg.text_vc);

As for my queue configuration I use the following setup

DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table=>'PRODUCER_QUEUES', multiple_consumers=>TRUE, queue_payload_type=>'SYS.AQ$_JMS_MAP_MESSAGE');
DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table=>'CONSUMER_QUEUES', multiple_consumers=>FALSE, queue_payload_type=>'SYS.AQ$_JMS_MAP_MESSAGE');

DBMS_AQADM.CREATE_QUEUE(queue_name => 'SEND_QUEUE', queue_table => 'PRODUCER_QUEUES');
DBMS_AQADM.CREATE_QUEUE(queue_name => 'RECEIVE_QUEUE', queue_table => 'CONSUMER_QUEUES');

DBMS_AQADM.START_QUEUE(queue_name => 'SEND_QUEUE');
DBMS_AQADM.START_QUEUE(queue_name => 'RECEIVE_QUEUE');

DBMS_AQADM.ADD_SUBSCRIBER(queue_name => 'SEND_QUEUE', subscriber => sys.aq$_agent(NULL, 'RECEIVE_QUEUE', NULL));

DBMS_AQADM.SCHEDULE_PROPAGATION(queue_name => 'SEND_QUEUE', latency => 0);

Can anyone tell what's causing this exception?
Thanks in advance.


Solution

  • I fixed this issue a while back and it was relatively simple. It turns out that calling the clear_body is not required to build up a new message. Based on the documentation it's kinda obvious and is something that you would use to rebuild your message body without clearing any header values.

    Documentation for more information

    I also switched the message type to JMS_TEXT_MESSAGE, as it better fit my needs.