0 Replies Latest reply: Mar 12, 2013 11:03 AM by 996373 RSS

    AQ+JMS+MQ. Can't set JMSReplyTo property for MQ-message

    996373
      Hello everyone!
      I'm trying to send JMS message to MQ-queue and I need to set fields ReplyToQ in MQMD and Rto in JMS section.

      I'm using:
      JMS_QUEUE_CONNECTION,
      Queue_payload_type => 'SYS.AQ$_JMS_BYTES_MESSAGE'
      FQ domain -> dbms_mgwadm.DOMAIN_QUEUE

      When I try to set properties using JMSReplyTo and JMS_IBM_MQMD_ReplyToQ, in result message in MQ-queue these properties doesn't set.

      I don't know how to set JMSReplyTo using v_jms_message.set_replyto(v_agent) , because v_agent has sys.aq$_agent type.

      <pre class="jive-pre">
      DECLARE
      queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;
      message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
      message_id RAW(16);
      p_xmlstring varchar2(3000);
      queue_name_val varchar2(100);
      v_agent sys.aq$_agent := sys.aq$_agent(' ', null, 0);
      v_jms_message sys.aq$_jms_bytes_message;
      enqueue_options dbms_aq.enqueue_options_t;
      msgid raw(16);
      l_header SYS.AQ$_JMS_HEADER;
      l_properties sys.AQ$_JMS_USERPROPARRAY;
      l_bytes_raw blob;
      l_length number;
      BEGIN
      queue_name_val := 'MQ_JMS_TEST';

      v_jms_message := sys.aq$_jms_bytes_message.construct;
      v_jms_message.set_replyto(v_agent);
      v_jms_message.set_type('mcd://xmlns');

      l_header := sys.aq$_jms_header
      (null,null,null,null,null,null,l_properties);

      dbms_lob.createtemporary(l_bytes_raw,true);
      l_bytes_raw:=utl_raw.cast_to_raw('<some_message>');
      l_length :=dbms_lob.getlength(l_bytes_raw);

      v_jms_message := sys.aq$_jms_bytes_message
      (l_header
      ,l_length
      ,null
      ,l_bytes_raw);

      v_jms_message.set_string_property('JMSReplyTo','queue://SOME_BROKER/SOME_QUEUE');
      -- v_jms_message.set_string_property('JMS_IBM_MQMD_ReplyToQ','SOME_QUEUE');

      DBMS_AQ.ENQUEUE(
      queue_name => queue_name_val,
      enqueue_options => queue_options,
      message_properties => message_properties,
      payload => v_jms_message,
      msgid => message_id);

      END;
      </pre>

      Can anybody help, please?