1 Reply Latest reply on Oct 14, 2007 3:27 PM by 601969

    Problem with Messaging Gateway (MGW) for MQ/JMS Propagation

    601969
      I've been struggling to get Oracle-JMS to MQ-JMS propagation working. I've been using MGW for AQ<-->MQ for some time now using the MGW cannonical type (SYS.MGW_BASIC_MSG_T).

      On the OracleAQ side, my queue table payload is SYS.AQ$_JMS_MESSAGE. My MQ message link is created with the "interface type" of DBMS_MGWADM.JMS_CONNECTION (I've also tried DBMS_MGWADM.JMS_QUEUE_CONNECTION). I'll provide the whole creation script below. Please keep in mind that I've had no problem with the same script and object creation when the queue table payload is SYS.MGW_BASIC_MSG_T and the MQ message link is created withe the "interface type" of DBMS_MGWADM.MQSERIES_BASE_JAVA_INTERFACE. In other words, the simple substitution of two things works correct. Of course, these substituions make it a native MQ propogation instead of a JMS MQ propagation. But, I really need to get MQ JMS propogation working as there are so many header and properties I need to keep intact for certaion EAI interfaces.

      Here is my creation script. Below this, I'll include the error in the MGW log file.

      **************************************************************************

      /* Formatted on 2007/10/13 12:25 (Formatter Plus v4.8.7) */

      SET ECHO ON

      DECLARE
      v_options SYS.mgw_properties;
      v_prop SYS.mgw_mqseries_properties;
      BEGIN
      v_prop := SYS.mgw_mqseries_properties.construct ();
      v_prop.interface_type := DBMS_MGWADM.JMS_CONNECTION;
      v_prop.max_connections := 10;
      -- v_prop.username := '*******';
      -- v_prop.PASSWORD := '*******';

      -- Setup some property options...
      v_options :=
      SYS.mgw_properties (SYS.mgw_property ('MQ_JmsTargetClient', 'TRUE'));
      -- Not used in BINDINGS Mode. These are CLIENT mode properties...
      -- v_prop.HOSTNAME := 'myhost.mydomain';
      -- v_prop.PORT := 1414;
      -- v_prop.CHANNEL := 'mychannel';

      -- All that is needed in Bindings Mode
      v_prop.queue_manager                := 'venus.queue.manager';
      v_prop.outbound_log_queue           := 'SAP.JMSTESTLOG';

      DBMS_MGWADM.create_msgsystem_link (linkname => 'MSL_VENUS_JMS',
      properties => v_prop,
      options => v_options
      );
      -- DBMS_MGWADM.create_msgsystem_link (linkname => 'MSL_venus_JMS', properties => v_prop );

      END;
      /


      BEGIN
      DBMS_MGWADM.register_foreign_queue (NAME => 'FQ_SAPJMSTEST',
      linkname => 'MSL_VENUS_JMS',
      provider_queue => 'SAP.JMSTEST',
      domain => DBMS_MGWADM.domain_queue
      );
      END;
      /

      BEGIN
      DBMS_MGWADM.add_subscriber
      (subscriber_id => 'SUB_SAPJMSTEST',
      propagation_type => DBMS_MGWADM.outbound_propagation,
      queue_name => 'jmsadmin.jms_bytes_que',
      destination => 'FQ_SAPJMSTEST@MSL_VENUS_JMS'
      );
      END;
      /

      BEGIN
      DBMS_MGWADM.schedule_propagation
      (schedule_id => 'SCH_SAPJMSTEST',
      propagation_type => DBMS_MGWADM.outbound_propagation,
      SOURCE => 'jmsadmin.jms_bytes_que',
      destination => 'FQ_SAPJMSTEST@MSL_VENUS_JMS',
      latency => 3
      );
      END;
      /

      **************************************************************************

      Here is the core of the error I'm getting. Again, please keep in mind that the same configuration items are working correction for non-JMS propogation.

      [oracleMgwAqJms] creating JMS Destination Queue: sys.mgw_jms_send_log
      2007-10-14 07:38:16 MGW Engine 0 429 worker0
      Failed to clean up log records of subscriber SUB_SAPJMSTEST
      oracle.mgw.common.GatewayException: [224] Failed to receive from queue SAP.JMSTESTLOG
           at oracle.mgw.common.MgwUtil.GatewayException(MgwUtil.java:739)
           at oracle.mgw.drivers.JmsConsumer.browse(JmsConsumer.java:395)
           at oracle.mgw.drivers.JmsConsumer.receive(JmsConsumer.java:206)
           at oracle.mgw.drivers.mq.jms.MQJmsLink.receive(MQJmsLink.java:1360)
           at oracle.mgw.engine.Worker.getEnqLogRecsForClean(Worker.java:2235)
           at oracle.mgw.engine.Worker.cleanJob(Worker.java:1020)
           at oracle.mgw.engine.Worker.myRun(Worker.java:92)
           at oracle.mgw.engine.ManagedThr.run(ManagedThr.java:58)

      [Linked-exception]
      javax.jms.InvalidDestinationException: MQJMS2008: failed to open MQ queue SAP.JMSTESTLOG
           at com.ibm.mq.jms.MQQueueServices.getQueueOpenException(MQQueueServices.java:412)
           at com.ibm.mq.jms.MQQueueServices.getQueueForBrowse(MQQueueServices.java:287)
           at com.ibm.mq.jms.JMSServicesMgr.getQueueForBrowse(JMSServicesMgr.java:161)
           at com.ibm.mq.jms.MQQueueBrowser.getEnumeration(MQQueueBrowser.java:199)
           at oracle.mgw.drivers.JmsConsumer.browse(JmsConsumer.java:391)
           at oracle.mgw.drivers.JmsConsumer.receive(JmsConsumer.java:206)
           at oracle.mgw.drivers.mq.jms.MQJmsLink.receive(MQJmsLink.java:1360)
           at oracle.mgw.engine.Worker.getEnqLogRecsForClean(Worker.java:2235)
           at oracle.mgw.engine.Worker.cleanJob(Worker.java:1020)
           at oracle.mgw.engine.Worker.myRun(Worker.java:92)
           at oracle.mgw.engine.ManagedThr.run(ManagedThr.java:58)

      [Linked-exception]
      com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2085
           at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2858)
           at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2915)
           at com.ibm.mq.jms.MQQueueServices.getQueueForBrowse(MQQueueServices.java:283)
           at com.ibm.mq.jms.JMSServicesMgr.getQueueForBrowse(JMSServicesMgr.java:161)
           at com.ibm.mq.jms.MQQueueBrowser.getEnumeration(MQQueueBrowser.java:199)
           at oracle.mgw.drivers.JmsConsumer.browse(JmsConsumer.java:391)
           at oracle.mgw.drivers.JmsConsumer.receive(JmsConsumer.java:206)
           at oracle.mgw.drivers.mq.jms.MQJmsLink.receive(MQJmsLink.java:1360)
           at oracle.mgw.engine.Worker.getEnqLogRecsForClean(Worker.java:2235)
           at oracle.mgw.engine.Worker.cleanJob(Worker.java:1020)
           at oracle.mgw.engine.Worker.myRun(Worker.java:92)
           at oracle.mgw.engine.ManagedThr.run(ManagedThr.java:58)

      It seems that the messaging gateway is failing to setup it's communication between the Oracle database internal propagation log queue sys.mgw_jms_send_log and the log queue I've setup on the MQ side. Again, I'm using the same MQ log queue for non-JMS propagation (as a test) and it works fine for that.

      blake
        • 1. Re: Problem with Messaging Gateway (MGW) for MQ/JMS Propagation
          601969
          Here is the script with two simple substitutions (the message link interface type and the subscriber AQ queue) that works fine. Again, this makes it a non-JMS propagation scheme...but, the point is that the same MQ queues (SAP.JMSTEST & SAP.JMSTESTLOG) work fine in this context.

          /* Formatted on 2007/10/13 18:56 (Formatter Plus v4.8.7) */

          SET ECHO ON

          DECLARE
          v_options SYS.mgw_properties;
          v_prop SYS.mgw_mqseries_properties;
          BEGIN
          v_prop := SYS.mgw_mqseries_properties.construct ();
          v_prop.interface_type := DBMS_MGWADM.mqseries_base_java_interface;
          v_prop.max_connections := 5;
          -- v_prop.username := '*******';
          -- v_prop.PASSWORD := '*******';

          -- Not used in BINDINGS Mode. These are CLIENT mode properties...
          -- v_prop.HOSTNAME := 'myhost.mydomain';
          -- v_prop.PORT := 1414;
          -- v_prop.CHANNEL := 'mychannel';

          -- All that is needed in Bindings Mode
          v_prop.queue_manager := 'venus.queue.manager';
          v_prop.outbound_log_queue := 'SAP.JMSTESTLOG';
          DBMS_MGWADM.create_msgsystem_link (linkname => 'MSL_VENUS_JMS',
          properties => v_prop
          );
          END;
          /


          BEGIN
          DBMS_MGWADM.register_foreign_queue (NAME => 'FQ_SAPJMSTEST',
          linkname => 'MSL_VENUS_JMS',
          provider_queue => 'SAP.JMSTEST',
          domain => DBMS_MGWADM.domain_queue
          );
          END;
          /


          BEGIN
          DBMS_MGWADM.add_subscriber
          (subscriber_id => 'SUB_SAPJMSTEST',
          propagation_type => DBMS_MGWADM.outbound_propagation,
          queue_name => 'jmsadmin.basic_message_t',
          destination => 'FQ_SAPJMSTEST@MSL_VENUS_JMS'
          );
          END;
          /


          BEGIN
          DBMS_MGWADM.schedule_propagation
          (schedule_id => 'SCH_SAPJMSTEST',
          propagation_type => DBMS_MGWADM.outbound_propagation,
          SOURCE => 'jmsadmin.basic_message_t',
          destination => 'FQ_SAPJMSTEST@MSL_VENUS_JMS',
          latency => 3
          );
          END;
          /