0 Replies Latest reply: May 31, 2013 6:01 AM by 332090 RSS

    JMSReplyTo property for MQ-message (trouble)

    332090
      Hello all!
      I'm trying to send JMS message to MQ-queue and I need to set field JMSReplyToQ in JMS section.

      I'm using:

      Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
      JMS_QUEUE_CONNECTION,
      Queue_payload_type => 'SYS.AQ$_JMS_TEXT_MESSAGE'
      FQ domain -> dbms_mgwadm.DOMAIN_QUEUE


      But I can’t set JMSReplyTo property for MQ-message. Please could you like help me for this trouble?


      See below my PL/SQL block:


      declare
      i_msg_id raw(24);
      l_id varchar2(25);
      l_msg_id raw(24);
      l_answer_queuename varchar2(80);
      l_answer_msg clob;
      l_answer_xml XMLType;
      --
      --
      procedure Put_MsgX (i_QueueName varchar2,
      i_msg CLOB,
      i_msg_id raw,
      i_characterSet number := 1208)
      is
      l_EnqueueOptions DBMS_AQ.ENQUEUE_OPTIONS_T;
      l_MsgProperties DBMS_AQ.MESSAGE_PROPERTIES_T;
      l_MsgID raw(16);
      l_msg_str CLOB:=i_msg;
      l_msg_str_len int;
      l_replyto sys.aq$_agent;
      l_header sys.aq$_jms_header;
      l_properties sys.aq$_jms_userproparray;
      l_mess_jms_text sys.aq$_jms_text_message;
      begin
      l_EnqueueOptions.visibility := DBMS_AQ.IMMEDIATE;

      -- Message object creating
      l_msg_str_len:=LENGTH(l_msg_str);
      l_mess_jms_text:=sys.aq$_jms_text_message(l_header
      ,l_msg_str_len
      ,l_msg_str
      ,null);

      -- MQRFH2 jms-folder properties
      l_mess_jms_text.set_groupid('grp_1');
      l_mess_jms_text.set_groupseq(5);
      -- Message corellation ID
      l_MsgProperties.correlation:='555D5120514D5F333C45584D4C2021115178D7BF20046922';
      -- Message priority
      l_MsgProperties.priority:=0;

      -- MQRFH2 usr-folder properties
      l_mess_jms_text.set_string_property('SOAPJMS_requestURI','jms:jndi:');
      l_mess_jms_text.set_string_property('SOAPJMS_contentType','text/xml; charset=utf-8');
      l_mess_jms_text.set_string_property('SOAPJMS_bindingVersion','1.0');

      /* -------- It is NOT WORKED !!! ----------------------------

      -- This code line isn’t effected to result (MQ Series message property ReplytoQ is empty)
      l_mess_jms_text.set_string_property('JMS_IBM_MQMD_ReplyToQ','queue:///PPV.JMS.MQ.OUT');

      -- This code line effected error
      -- oracle.jms.AQjmsException: JMS-147: Invalid ReplyTo destination type, or use of reserved `JMSReplyTo agent name,
      -- or serialization error with AQjmsDestination

      l_replyto:=sys.aq$_agent(null,'FXGTST.JMS_OUT',null);
      l_mess_jms_text.set_replyto(l_replyto);

      ----------------------------------------------------------- */

      -- Sending message to MQ Series queue
      dbms_aq.enqueue(queue_name => i_QueueName,
      enqueue_options => l_EnqueueOptions,
      message_properties => l_MsgProperties,
      payload => l_mess_jms_text,
      msgid => l_MsgID);

      exception
      when others then
      Raise;
      end;
      --
      --
      begin
      i_msg_id:=UTL_RAW.SUBSTR(UTL_RAW.CAST_TO_RAW(SUBSTR(LPAD('999888777',24,'0'),1,24)),1,24);
      l_msg_id:=i_msg_id;

      l_answer_msg:=
      '<?xml version="1.0" encoding="UTF-8"?>'||
      '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
      '<SOAP-ENV:Header>'||
      '<m:UCBRUHeaders xmlns:m="urn:ucbru:gbo:v3"></m:UCBRUHeaders>'||
      '</SOAP-ENV:Header>'||
      '<SOAP-ENV:Body>'||
      -- some XML elements
      '</SOAP-ENV:Body>'||
      '</SOAP-ENV:Envelope>';

      l_answer_xml:=xmltype(l_answer_msg);
      l_answer_queuename :='FXGTST.JMS_IN';

      Put_MsgX(l_answer_queuename,l_answer_msg,l_msg_id);
      commit;

      exception
      when others then
      raise_application_error(-20020, 'Error: '||sqlerrm||' Queue='||l_answer_queuename);
      end;