Настройка msmq windows 10

Обновлено: 07.07.2024

Настройка MSMQ для рабочих процессов SharePoint Configure MSMQ for SharePoint workflows

Рабочие процессы SharePoint 2010 были отменены с 1 августа 2020 для новых клиентов и удалены из существующих клиентов на 1 ноября 2020. SharePoint 2010 workflows have been retired since August 1, 2020 for new tenants and removed from existing tenants on November 1, 2020. Если вы используете рабочие процессы SharePoint 2010, рекомендуем переходить на Power автоматизация или другие поддерживаемые решения. If you’re using SharePoint 2010 workflows, we recommend migrating to Power Automate or other supported solutions. Более подробную информацию можно узнать в статье SharePoint 2010 Workflow упразднение рабочего процесса. For more info, see SharePoint 2010 workflow retirement.

Включение MSMQ Enabling MSMQ

Важно! Снимки экрана включены в состав Windows Server 2008 R2. Important: The screen shots included here are from Windows Server 2008 R2. Пользовательский Интерфейс может отличаться от эта функция включена в Windows Server 2012. The UI may change for enabling this feature in Windows Server 2012.

На компьютере SharePoint Server откройте Диспетчер сервера. On your SharePoint Server computer, open Server Manager.


Теперь необходимо перезагрузить компьютер. You must now restart your computer.


Устранение неполадок MSMQ Troubleshooting MSMQ

Центр разработчиков Windows предоставляет подробную документацию MSMQ. Ниже перечислены некоторые полезные ресурсы. The Windows Developer Center provides extensive documentation of MSMQ. Following are some useful resources:

Message Queuing (MSMQ)

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Purpose

Message Queuing (MSMQ) technology enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Applications send messages to queues and read messages from queues. The following illustration shows how a queue can hold messages that are generated by multiple sending applications and read by multiple receiving applications.

Where Applicable

Message Queuing provides guaranteed message delivery, efficient routing, security, and priority-based messaging.

It can be used to implement solutions to both asynchronous and synchronous scenarios requiring high performance. The following list shows several places where Message Queuing can be used.

Mission-critical financial services: for example, electronic commerce.

Embedded and hand-held applications: for example, underlying communications to and from embedded devices that route baggage through airports by means of an automatic baggage system.

Outside sales: for example, sales automation applications for traveling sales representatives.

Workflow: Message Queuing makes it easy to create a workflow that updates each system. A typical design pattern is to implement an agent to interact with each system. Using a workflow-agent architecture also minimizes the impact of changes in one system on the other systems. With Message Queuing, the loose coupling between systems makes upgrading individual systems simpler.

Developer Audience

Run-Time Requirements

MSMQ 3.0 can be deployed on computers running Microsoft Windows and members of the Windows Server family.

MSMQ is also available with independent client functionality on computers running Windows CE 3.0.

Interoperability

More information

For information on the following:

Sources of information on installation and administration and books on Message Queuing. See More Information on Message Queuing.

Message Queuing concepts and services. See About Message Queuing.

Examples using API functions and COM components. See Using Message Queuing.

Message Queuing functions, properties, structures, and COM components. See Message Queuing Reference.

Technical terms used in the Message Queuing documentation. See Message Queuing Glossary.

Supplementary information not covered in the body of the Message Queuing documentation. See Message Queuing Appendix.

Установка Message Queuing 4.0 в Windows Server 2008 или Windows Server 2008 R2 To install Message Queuing 4.0 on Windows Server 2008 or Windows Server 2008 R2

В диспетчер сервера щелкните компоненты. In Server Manager, click Features.

В области справа в разделе Сводка компонентов щелкните Добавить компоненты. In the right-hand pane under Features Summary, click Add Features.

Откройте Панель управления. Open Control Panel.

MSMQ Доменные службы Active Directory (для компьютеров, подключенных к домену). MSMQ Active Directory Domain Services Integration (for computers joined to a Domain).

Установка Message Queuing 3.0 в Windows XP или Windows Server 2003 To install Message Queuing 3.0 on Windows XP and Windows Server 2003

Откройте Панель управления. Open Control Panel.

Активация MSMQ MSMQ Activation

Процедура настройки и инструкции по построению для данного образца приведены в конце этого раздела. The setup procedure and build instructions for this sample are located at the end of this topic.

Образцы уже могут быть установлены на компьютере. The samples may already be installed on your computer. Перед продолжением проверьте следующий каталог (по умолчанию). Check for the following (default) directory before continuing.

Клиент отправляет службе заказы на покупку из области транзакции. The client sends purchase orders to the service from within the scope of a transaction. Служба получает заказы в транзакцию и обрабатывает их. The service receives the orders in a transaction and processes them. После этого служба возвращает клиенту состояние заказа. The service then calls back the client with the status of the order. Для двустороннего взаимодействия и клиент, и служба используют очереди для заказов на покупку и состояний заказов. To facilitate two-way communication the client and service both use queues to enqueue purchase orders and order status.

Контракт ответа для отправки состояния заказа задается клиентом. The reply contract to send order status to is specified by the client. Клиент реализует контракт состояния заказа. The client implements the order status contract. Служба использует созданного клиента этого контракта для отправки состояния заказа клиенту. The service uses the generated client of this contract to send order status back to the client.

Операция службы, помимо обработки отправленного заказа на покупку, возвращает клиенту состояние заказа. The service operation, in addition to processing the submitted purchase order, replies back to the client about the status of the order.

Используемая клиентом привязка задается при помощи файла конфигурации. The client binding to use is specified using a configuration file.

Имя очереди MSMQ задается в разделе appSettings файла конфигурации. The MSMQ queue name is specified in an appSettings section of the configuration file. Конечная точка службы определяется в разделе System.serviceModel файла конфигурации. The endpoint for the service is defined in the System.serviceModel section of the configuration file.

Файл Service.svc также содержит директиву сборки для проверки загрузки System.Transactions.dll. The Service.svc file also contains an assembly directive to ensure that System.Transactions.dll is loaded.

Код клиента реализует контракт IOrderStatus для получения от службы состояния заказа. The client code implements the IOrderStatus contract to receive order status from the service. В данном случае он выводит состояние заказа. In this case, it prints out the order status.

Клиент отображает сведения о состоянии заказа, отправленные сервером. The client displays the order status information sent by the server:

Настройка, сборка и выполнение образца To set up, build, and run the sample

Убедитесь, что установлен IIS 7,0, так как он необходим для активации WAS. Ensure that IIS 7.0 is installed, as it is required for WAS activation.

В меню Пуск выберите Панель управления. From the Start menu, choose Control Panel.

Выберите программы и компоненты. Select Programs and Features.

Щелкните Включение или отключение компонентов Windows. Click Turn Windows Features on or off.

В разделе Сводка компонентов щелкните Добавить компоненты. Under Features Summary, click Add Features.

В меню Пуск выберите пункт выполнить, а затем введите Compmgmt.msc и нажмите клавишу ВВОД. From the Start menu, click Run, then type Compmgmt.msc and press ENTER.

Щелкните частные очереди. Click Private Queues.

Щелкните правой кнопкой мыши очередь (servicemodelsamples/Service. svc) и выберите пункт Свойства. Right-click the queue (servicemodelsamples/Service.svc) and choose Properties.

На вкладке Безопасность щелкните Добавить и предоставьте разрешения Просмотр и получение для сетевой службы. On the Security tab, click Add and give peek and receive permissions to Network Service.

Настройка службы активации Windows (WAS) для поддержки активации MSMQ. Configure the Windows Process Activation Service (WAS) to support MSMQ activation.

Для удобства следующие действия выполняются в пакетном файле AddMsmqSiteBinding.cmd, расположенном в каталоге образца. As a convenience, the following steps are implemented in a batch file called AddMsmqSiteBinding.cmd located in the sample directory.

Для поддержки активации net.msmq сначала необходимо привязать веб-узел по умолчанию к протоколу net.msmq. To support net.msmq activation, the default Web site must first be bound to the net.msmq protocol. Сделать это позволяет файл Appcmd.exe, который устанавливается с помощью набора инструментов управления IIS 7.0. This can be done using appcmd.exe, which is installed with the IIS 7.0 management toolset. В командной строке с повышенными привилегиями (с правами администратора) выполните следующую команду. From an elevated (administrator) command prompt, run the following command.

Эта команда представляет собой одну строку текста. This command is a single line of text.

Эта команда добавляет для веб-узел по умолчанию привязку net.msmq. This command adds a net.msmq site binding to the default Web site.

Хотя все приложения на узле имеют общую привязку net.msmq, включать поддержку net.msmq можно для каждого приложения отдельно. Although all applications within a site share a common net.msmq binding, each application can enable net.msmq support individually. Чтобы включить net.msmq для приложения /servicemodelsamples, выполните следующую команду из командной строки с повышенными привилегиями. To enable net.msmq for the /servicemodelsamples application, run the following command from an elevated command prompt.

Эта команда представляет собой одну строку текста. This command is a single line of text.

Чтобы запустить пример в конфигурации с одним или несколькими компьютерами, следуйте инструкциям в разделе выполнение примеров Windows Communication Foundation. To run the sample in a single- or cross-computer configuration, follow the instructions in Running the Windows Communication Foundation Samples. Кроме того, можно изменить код на клиенте, который отправляет заказ на покупку, для отражения имени компьютера и URI очереди при отправке заказа на покупку. Additionally, change the code on the client that submits the purchase order to reflect the computer name in the URI of the queue when submitting the purchase order. Используйте следующий код: Use the following code:

Удалите привязку узла net.msmq, добавленную ранее для данного образца. Remove the net.msmq site binding you added for this sample.

Для удобства следующие действия выполняются в пакетном файле RemoveMsmqSiteBinding.cmd, расположенном в каталоге с образцом. As a convenience, the following steps are implemented in a batch file called RemoveMsmqSiteBinding.cmd located in the sample directory:

Удалите net.msmq из списка включенных протоколов, выполнив следующую команду из командной строки с повышенными привилегиями. Remove net.msmq from the list of enabled protocols by running the following command from an elevated command prompt.

Эта команда представляет собой одну строку текста. This command is a single line of text.

Удалите привязку узла net.msmq, выполнив следующую команду из командной строки с повышенными привилегиями. Remove the net.msmq site binding by running the following command from an elevated command prompt.

Эта команда представляет собой одну строку текста. This command is a single line of text.

Выполнение образца на компьютере, входящем в рабочую группу To run the sample on a computer joined to a workgroup

Если компьютер не входит в домен, отключите безопасность транспорта, задав для режима проверки подлинности и уровня защиты значение None, как показано в следующем образце конфигурации. If your computer is not part of a domain, turn off transport security by setting the authentication mode and protection level to none as shown in the following sample configuration.

Перед выполнением образца измените конфигурацию как сервера, так и клиента. Change the configuration on both the server and the client before you run the sample.

Для включения активации на компьютере, входящем в рабочую группу, и служба активации, и рабочий процесс должны быть запущены в определенной учетной записи пользователя (должна быть одинаковой для обоих), а очередь должна иметь ACL для определенной учетной записи пользователя. To enable activation in a computer joined to a workgroup, both the activation service and the worker process must be run with a specific user account (must be same for both) and the queue must have ACLs for the specific user account.

Изменение удостоверения, с которым выполняется рабочий процесс. To change the identity that the worker process runs under:

Запустите файл Inetmgr.exe. Run Inetmgr.exe.

Измените свойства удостоверения для использования определенной учетной записи пользователя. Change the Identity properties to use the specific user account.

Изменение удостоверения, с которым выполняется служба активации. To change the identity that the Activation Service runs under:

Запустите файл Services.msc. Run Services.msc.

Щелкните правой кнопкой мыши адаптер NET. мсмклистенер и выберите пункт свойства. Right-click the Net.MsmqListener Adapter, and choose Properties.

В рабочей группе служба должна выполняться с маркером неограниченного доступа. In workgroup, the service must also run using an unrestricted token. Для этого запустите в командном окне следующее: To do this, run the following in a command window:

Читайте также: