public IDestination CreateMQDestination(ISession sess, String queueName) { IDestination dest = sess.CreateQueue(queueName); dest.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ); // exclude RFH2 header since amqchange.exe cannot handle return(dest); }
private void Connect() { factory = XmsUtilities.CreateConnectionFactory(destination); connection = factory.CreateConnection(); connection.ExceptionListener += OnError; session = connection.CreateSession(transactional, AcknowledgeMode.AutoAcknowledge); queue = session.CreateQueue(destination.Queue); queue.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_PERSISTENT); producer = session.CreateProducer(queue); }
public void Connect() { log.Debug("New physical producer created. About to connect."); factory = XmsUtilities.CreateConnectionFactory(address); connection = factory.CreateConnection(); connection.ExceptionListener += OnError; session = connection.CreateSession(transactional, AcknowledgeMode.AutoAcknowledge); queue = session.CreateQueue(address.Queue); queue.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_PERSISTENT); producer = session.CreateProducer(queue); connected = true; log.Debug("New physical producer successfully connected."); }
public void Connect() { factory = XmsUtilities.CreateConnectionFactory(address); connection = factory.CreateConnection(); connection.ExceptionListener += OnError; session = connection.CreateSession(transactional, AcknowledgeMode.AutoAcknowledge); queue = session.CreateQueue(address.Queue); queue.SetIntProperty(XMSC.DELIVERY_MODE, transactional ? XMSC.DELIVERY_PERSISTENT : XMSC.DELIVERY_NOT_PERSISTENT); consumer = session.CreateConsumer(queue); connection.Start(); connected = true; }
private IDestination GetDestination(bool isPublish, ISession session) { IDestination result = null; if (isPublish) { result = session.CreateTopic(_mqConfigModel.TopicName); result.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ); } else { result = session.CreateQueue(_mqConfigModel.QueueName); } return(result); }
/// <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); }
/// <summary> /// ������� /// </summary> protected override void Open() { // �ȴ�Session base.Open(); // ����Ŀ�ĵ� _destination = Session.CreateQueue(_queueName); _destination.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_PERSISTENT); // ��������� _browser = Session.CreateBrowser(_destination); }