⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 transactedmessagemediator_msmq.cs

📁 SQL Server 2005 Service Broker (SSB) is an asynchronous messaging technology built into SQL Server.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Messaging;
using System.Xml;

namespace SSBExternalActivationRouter
{
    class TransactedMessageMediator_MSMQ : ITransactedMessageMediator
    {
        MessageQueue _msgQueue;

        public void Translate(SSBMessage msg)
        {
            XmlDocument xml = new XmlDocument();
            xml.Load(msg.Body);

            _msgQueue.Send(xml.OuterXml);

            //You can also do this in a transaction
            //because of distributed issues, what's the point?
        }

        public void Init(object obj)
        {
            _msgQueue = new MessageQueue((string)obj); //Remember to create this Queue
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -