コード例 #1
0
        /// <summary>
        /// Initialize an MQ Destination/Queue from the given MQ Session and Queue Name
        /// </summary>
        /// <param name="sess"></param>
        /// <param name="queueName"></param>
        /// <returns></returns>
        public IDestination CreateMQDestination(ISession sess, String name)
        {
            IDestination dest = null;

            if (MQTypes.QUEUE == _mqType)
            {
                dest = sess.CreateQueue(name);
                dest.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ); // exclude RFH2 header since amqchange.exe cannot handle
            }
            else if (MQTypes.TOPIC == _mqType)
            {
                dest = sess.CreateTopic(name);
                dest.SetStringProperty(XMSC.WMQ_TOPIC_NAME, name);
            }

            return(dest);
        }