{"id":280250,"date":"2016-11-01T01:10:04","date_gmt":"2016-10-31T22:10:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280250"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280250","title":{"rendered":"\u041e\u043f\u044b\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f MassTransit 3.0"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6cd\/ded\/a5e\/6cddeda5ee8f4d3cb5c9dbb557aef6b0.png\" align=\"right\" width=\"325\"\/>MassTransit \u044d\u0442\u043e open source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C# \u0434\u043b\u044f .NET \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0448\u0438\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 SOA (service oriented architecture).<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 message broker \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c RabbitMq, Azure Service Bus \u0438\u043b\u0438 In-Memory \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 In-Memory \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440).<br \/>  <a name=\"habracut\"><\/a><br \/>  <b>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/b>  <\/p>\n<ul>\n<li><a href=\"#command-event\">\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/a><br \/> \n<ul>\n<li><a href=\"#command\">\u041a\u043e\u043c\u0430\u043d\u0434\u044b<\/a><\/li>\n<li><a href=\"#event\">\u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#contract\">\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/a><\/li>\n<li><a href=\"#routing\">\u0420\u043e\u0443\u0442\u0438\u043d\u0433<\/a><br \/> \n<ul>\n<li><a href=\"#exchange\">Exchange<\/a><\/li>\n<li><a href=\"#message-body\">\u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a href=\"#consumer\">\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u044b (Consumer)<\/a><\/li>\n<li><a href=\"#di\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 DI<\/a><\/li>\n<li><a href=\"#observer\">\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u0438 (Observer)<\/a><\/li>\n<li><a href=\"#new-30\">\u041d\u043e\u0432\u043e\u0435 \u0432 MassTransit 3.0<\/a><\/li>\n<li><a href=\"#ps\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"#poll\">\u041e\u043f\u0440\u043e\u0441: \u0410 \u043a\u0430\u043a\u0443\u044e .NET \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u044b?<\/a><\/li>\n<\/ul>\n<p>  <a name=\"command-event\"><\/a><\/p>\n<h2>\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/h2>\n<p>  \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e 2 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439: \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f.<\/p>\n<p>  <a name=\"command\"><\/a><\/p>\n<h3>\u041a\u043e\u043c\u0430\u043d\u0434\u044b<\/h3>\n<p>  \u0421\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u0414\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0433\u043b\u0430\u0433\u043e\u043b + \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435: EstimateConnection, SendSms, NotifyCustomerOrderProcessed.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 Send (\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/develop\/src\/MassTransit\/ISendEndpoint.cs\">ISendEndpoint<\/a>) \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f endpoint (\u043e\u0447\u0435\u0440\u0435\u0434\u0438):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">private static async Task SendSmsCommand(IBus busControl) {    var command = new SendSmsCommand    {        CommandId = Guid.NewGuid(),        PhoneNumber = &quot;89031112233&quot;,        Message = &quot;Thank you for your reply&quot;    };     var endpoint = await busControl.GetSendEndpoint(AppSettings.CommandEndpoint);    await endpoint.Send(command); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"event\"><\/a><\/p>\n<h3>\u0421\u043e\u0431\u044b\u0442\u0438\u044f<\/h3>\n<p>  \u0421\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043e \u0441\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435\u043a\u043e\u0435\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432 (\u043f\u0430\u0442\u0442\u0435\u0440\u043d Observer), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u044d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: ConnectionEstimated, CallTerminated, SmsSent, CustomerNotified. <\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 Publish (\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/develop\/src\/MassTransit\/IPublishEndpoint.cs\">IPublishEndpoint<\/a>).<\/p>\n<p>  \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435 \u044d\u0442\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044e (\u0434\u0430\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/938\/955\/2b8\/9389552b8349466fb8b5c7a4be8f212e.png\"\/><br \/>  \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/www.maldworth.com\/2015\/10\/27\/masstransit-send-vs-publish\/\">MassTransit Send vs. Publish<\/a><\/p>\n<p>  \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 n-\u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u0441\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a66\/17a\/7e5\/a6617a7e54464fa3a649982c2d8eb64e.png\"\/><br \/>  \u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/www.maldworth.com\/2015\/10\/27\/masstransit-send-vs-publish\/\">MassTransit Send vs. Publish<\/a><\/p>\n<p>  \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 n-\u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u0432 (\u043e\u0442 \u0430\u043d\u0433\u043b. consumer \u2014 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a), \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u043e\u0441\u043b\u0435 \u0435\u0451 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u0439, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043a\u0430\u0436\u0434\u044b\u0439.<\/p>\n<p>  <a name=\"contract\"><\/a><\/p>\n<h2>\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439<\/h2>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 MassTransit, \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 <a href=\"http:\/\/docs.masstransit-project.com\/en\/latest\/usage\/messages.html\">\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f<\/a> \u043f\u0440\u0438\u0431\u0435\u0433\u0430\u0442\u044c \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 : \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0421\u041c\u0421 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public interface ISendSms { \tGuid CommandId { get; } \tstring PhoneNumber { get; } \tstring Message { get; } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 Send (\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IBus) \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430\u0442\u0430 (endpoint).<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442: \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0421\u041c\u0421 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public interface ISmsSent { \tGuid EventId { get; } \tDateTime SentAtUtc { get; }\t } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 Publish.<\/p>\n<p>  <a name=\"routing\"><\/a><\/p>\n<h2>\u0420\u043e\u0443\u0442\u0438\u043d\u0433<\/h2>\n<p>  \u041a\u0430\u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043f\u043e exchange, \u0442\u0430\u043a \u0438 \u0432\u044b\u0431\u043e\u0440 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u0432 (\u043e \u043d\u0438\u0445 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435) \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430 runtime \u0442\u0438\u043f\u0430\u0445 \u044d\u0442\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439,- \u0432 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f namespace \u0438 \u0438\u043c\u044f \u0442\u0438\u043f\u0430, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 generic \u0438\u043c\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0438 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <a name=\"exchange\"><\/a><\/p>\n<h3>Exchange<\/h3>\n<p>  \u041f\u0440\u0438 <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/699b167645b7c6f2df10483378420f586b358dc4\/src\/MassTransit\/Configuration\/ConsumeConfigurators\/HandlerConfigurator.cs#L53\">\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 receive endpoint<\/a>\u2018a (\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u0432) \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0430\u043d\u0430\u043b\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 RabbitMq \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u0430\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/b488f08beed692e0a9acaa6a45fb022a7ce457bc\/src\/MassTransit.RabbitMqTransport\/Topology\/RabbitMqExchangeBindingExtensions.cs#L24\">\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f<\/a> \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 exchange, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/f3dbf6d0377d6494cffd02fa10e0eb50d0337fb9\/src\/MassTransit.RabbitMqTransport\/Transport\/RabbitMqPublishEndpointProvider.cs#L96\">\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 send endpoint<\/a>\u2018a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0438 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434, \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0430\u043a\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 exchange.<\/p>\n<p>  \u041d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043c\u043e\u0435\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f exchange:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/04e\/ceb\/d75\/04ecebd75f8f457283d98f45b14d4701.png\"\/><\/p>\n<p>  \u0412 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044f receive endpoint \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0447\u0435\u0440\u0435\u0434\u0438:<\/p>\n<pre><code class=\"cs\">cfg.ReceiveEndpoint(host, &quot;play_with_masstransit_queue&quot;, e =&gt; e.LoadFrom(container)); <\/code><\/pre>\n<p>  \u0442\u043e \u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430\u0445 exchange \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1b9\/cf7\/572\/1b9cf757267244b2a25cdb32c1b3908a.png\"\/><\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0442\u0438\u043f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 ISmsEvent, \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/842\/8f1\/37f\/8428f137f57f4193adc5648d0d11d371.png\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u0438:<\/p>\n<pre><code class=\"cs\">cfg.ReceiveEndpoint(host, e=&gt; e.LoadFrom(container)); <\/code><\/pre>\n<p>  \u0422\u043e \u0438\u043c\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e exchange \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0430 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u044b: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/680\/1cb\/3d5\/6801cb3d50074c6caa68f8202c693a8b.png\"\/><\/p>\n<p>  <a name=\"message-body\"><\/a><\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/h3>\n<p>  \u0413\u043e\u0432\u043e\u0440\u044f \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 (\u0438\u043b\u0438 messageType). \u0417\u0430 \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 urn:message:) \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/github.com\/MassTransit\/MassTransit\/blob\/b488f08beed692e0a9acaa6a45fb022a7ce457bc\/src\/MassTransit\/MessageUrn.cs#L85\">GetUrnForType(Type type)<\/a>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b ISendSms \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 ICommand \u0438 generic \u0442\u0438\u043f:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 : \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0421\u041c\u0421 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f ICommand&lt;string&gt;<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public interface ICommand&lt;T&gt; { }  public interface ISendSms&lt;T&gt; : ICommand&lt;T&gt; {    Guid CommandId { get; }    string PhoneNumber { get; }    string Message { get; } }  class SendSmsCommand : ISendSms&lt;string&gt; {    public Guid CommandId { get; set; }    public string PhoneNumber { get; set; }    public string Message { get; set; } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u043e\u043b\u0435 messageType (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0435\u043c \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440):<\/p>\n<pre><code class=\"javascript\">&quot;messageType&quot;: [     &quot;urn:message:PlayWithMassTransit30.Extension:SendSmsCommand&quot;,     &quot;urn:message:PlayWithMassTransit30.Contract.Command:ISendSms[[System:String]]&quot;,     &quot;urn:message:PlayWithMassTransit30.Contract.Command:ICommand[[System:String]]&quot; ] <\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 messageType \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e host, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e:<\/p>\n<pre><code class=\"javascript\">&quot;host&quot;: {     &quot;machineName&quot;: &quot;DESKTOP-SI9OHUR&quot;,     &quot;processName&quot;: &quot;PlayWithMassTransit30.vshost&quot;,     &quot;processId&quot;: 1092,     &quot;assembly&quot;: &quot;PlayWithMassTransit30&quot;,     &quot;assemblyVersion&quot;: &quot;1.0.0.0&quot;,     &quot;frameworkVersion&quot;: &quot;4.0.30319.42000&quot;,     &quot;massTransitVersion&quot;: &quot;3.4.1.808&quot;,     &quot;operatingSystemVersion&quot;: &quot;Microsoft Windows NT 6.2.9200.0&quot; } <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0438\u043c\u0443\u044e \u0447\u0430\u0441\u0442\u044c payload:<\/p>\n<pre><code class=\"javascript\">&quot;message&quot;: {     &quot;commandId&quot;: &quot;7388f663-82dc-403a-8bf9-8952f2ff262e&quot;,     &quot;phoneNumber&quot;: &quot;89031112233&quot;,     &quot;message&quot;: &quot;Thank you for your reply&quot; } <\/code><\/pre>\n<p>  \u0438 \u0438\u043d\u044b\u0435 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438.<\/p>\n<p>  <a name=\"consumer\"><\/a><\/p>\n<h2>\u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u044b (Consumer)<\/h2>\n<p>  \u041a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440 \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IConsumer, \u0433\u0434\u0435 T \u044d\u0442\u043e \u0442\u0438\u043f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u0430, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 ISendSms \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 ISmsSent:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SendSmsConsumer: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class SendSmsConsumer : IConsumer&lt;ISendSms&lt;string&gt;&gt; {    public SendSmsConsumer(IBusControl busControl)    {        _busControl = busControl;    }     public async Task Consume(ConsumeContext&lt;ISendSms&lt;string&gt;&gt; context)    {        var message = context.Message;         Console.WriteLine($&quot;[IConsumer&lt;ISendSms&gt;] Send sms command consumed&quot;);        Console.WriteLine($&quot;[IConsumer&lt;ISendSms&gt;] CommandId: {message.CommandId}&quot;);        Console.WriteLine($&quot;[IConsumer&lt;ISendSms&gt;] Phone number: {message.PhoneNumber}&quot;);        Console.WriteLine($&quot;[IConsumer&lt;ISendSms&gt;] Message: {message.Message}&quot;);         Console.Write(Environment.NewLine);        Console.WriteLine(&quot;\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f: \u0421\u043c\u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e&quot;);        await _busControl.SmsSent(DateTime.UtcNow);    }     private readonly IBus _busControl; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043c\u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043c\u0441 \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e.<\/p>\n<p>  \u041a\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u044f \u0432\u044b\u043d\u0435\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 Extension \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0434 IBusControl, \u0442\u0430\u043c \u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u0435\u0442\u043e\u0434\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u0434 IBus \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u043c\u0435\u0436\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static class BusExtensions {    \/\/\/ &lt;summary&gt;    \/\/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0441\u043c\u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f    \/\/\/ &lt;\/summary&gt;    \/\/\/ &lt;param name=&quot;bus&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;host&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;phoneNumber&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;message&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;returns&gt;&lt;\/returns&gt;    public static async Task SendSms(        this IBus bus, Uri host, string phoneNumber, string message    )    {        var command = new SendSmsCommand        {            CommandId = Guid.NewGuid(),            PhoneNumber = phoneNumber,            Message = message        };         await bus.SendCommand(host, command);    }     \/\/\/ &lt;summary&gt;    \/\/\/ \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e\u0431 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043c\u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f    \/\/\/ &lt;\/summary&gt;    \/\/\/ &lt;param name=&quot;bus&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;sentAtUtc&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;returns&gt;&lt;\/returns&gt;    public static async Task SmsSent(        this IBus bus, DateTime sentAtUtc    )    {        var @event = new SmsSentEvent        {            EventId = Guid.NewGuid(),            SentAtUtc = sentAtUtc        };         await bus.PublishEvent(@event);    }     \/\/\/ &lt;summary&gt;    \/\/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b    \/\/\/ &lt;\/summary&gt;    \/\/\/ &lt;typeparam name=&quot;T&quot;&gt;&lt;\/typeparam&gt;    \/\/\/ &lt;param name=&quot;bus&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;address&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;command&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;returns&gt;&lt;\/returns&gt;    private static async Task SendCommand&lt;T&gt;(this IBus bus, Uri address, T command) where T : class    {        var endpoint = await bus.GetSendEndpoint(address);        await endpoint.Send(command);    }     \/\/\/ &lt;summary&gt;    \/\/\/ \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f    \/\/\/ &lt;\/summary&gt;    \/\/\/ &lt;typeparam name=&quot;T&quot;&gt;&lt;\/typeparam&gt;    \/\/\/ &lt;param name=&quot;bus&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;param name=&quot;message&quot;&gt;&lt;\/param&gt;    \/\/\/ &lt;returns&gt;&lt;\/returns&gt;    private static async Task PublishEvent&lt;T&gt;(this IBus bus, T message) where T : class    {        await bus.Publish(message);    } }  class SendSmsCommand : ISendSms&lt;string&gt; {    public Guid CommandId { get; set; }    public string PhoneNumber { get; set; }    public string Message { get; set; } }  class SmsSentEvent : ISmsSent {    public Guid EventId { get; set; }    public DateTime SentAtUtc { get; set; } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0443\u0434\u0430\u0447\u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043e\u0442 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e (\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u0433\u043e) \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<\/p>\n<p>  <a name=\"di\"><\/a><\/p>\n<h2>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 DI<\/h2>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 MassTransit \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 <a href=\"http:\/\/docs.masstransit-project.com\/en\/latest\/usage\/containers\/index.html\">\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b<\/a>:  <\/p>\n<ol>\n<li>Autofac;<\/li>\n<li>Ninject;<\/li>\n<li>StructureMap;<\/li>\n<li>Unity;<\/li>\n<li>Castle Windsor.<\/li>\n<\/ol>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 UnityContainer \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c nuget package MassTransit.Unity, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f LoadFrom:<\/p>\n<pre><code class=\"cs\">public static class UnityExtensions {     public static void LoadFrom(this IReceiveEndpointConfigurator configurator, IUnityContainer container); } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f IBusControl \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e UnityContainer<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static IBusControl GetConfiguredFactory(IUnityContainer container) {    if (container == null)    {        throw new ArgumentNullException(nameof(container));    }     var control = Bus.Factory.CreateUsingRabbitMq(cfg =&gt; {        var host = cfg.Host(AppSettings.Host, h =&gt; { });          \/\/ cfg.ReceiveEndpoint(host, e =&gt; e.LoadFrom(container));        cfg.ReceiveEndpoint(host, &quot;play_with_masstransit_queue&quot;, e =&gt; e.LoadFrom(container));    });     control.ConnectConsumeObserver(new ConsumeObserver());    control.ConnectReceiveObserver(new ReceiveObserver());    control.ConnectConsumeMessageObserver(new ConsumeObserverSendSmsCommand());    control.ConnectSendObserver(new SendObserver());    control.ConnectPublishObserver(new PublishObserver());     return control; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0440\u043e\u043a\u0430 \u0436\u0438\u0437\u043d\u0438 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u0432 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 <a href=\"http:\/\/docs.masstransit-project.com\/en\/latest\/usage\/containers\/unity.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ContainerControlledLifetimeManager().<\/p>\n<p>  <a name=\"observer\"><\/a><\/p>\n<h2>\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u0438 (Observer)<\/h2>\n<p>  \u0414\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u0435\u0439 (Observer). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e MassTransit \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432:  <\/p>\n<ol>\n<li>IReceiveObserver- \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f RecieveContext;<\/li>\n<li>IConsumeObserver \u2014 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f ConsumeContext;<\/li>\n<li>IConsumeMessageObserver&lt;T&gt; \u2014 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u0430 T, \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0441\u0442\u0440\u043e\u0433\u043e-\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f;<\/li>\n<li>ISendObserver \u2014 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438;<\/li>\n<li>IPublishObserver \u2014 \u0434\u043b\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IBusControl \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434 IBusControl.Start().<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f ConsumeObserver:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f IConsumeObsever<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public class ConsumeObserver : IConsumeObserver {    public Task PreConsume&lt;T&gt;(ConsumeContext&lt;T&gt; context) where T : class    {        Console.WriteLine($&quot;[ConsumeObserver] PreConsume {context.MessageId}&quot;);        return Task.CompletedTask;    }     public Task PostConsume&lt;T&gt;(ConsumeContext&lt;T&gt; context) where T : class    {        Console.WriteLine($&quot;[ConsumeObserver] PostConsume {context.MessageId}&quot;);        return Task.CompletedTask;    }     public Task ConsumeFault&lt;T&gt;(ConsumeContext&lt;T&gt; context, Exception exception) where T : class    {        Console.WriteLine($&quot;[ConsumeObserver] ConsumeFault {context.MessageId}&quot;);        return Task.CompletedTask;    } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u0434 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u043d\u0441\u044c\u044e\u043c\u0435\u0440\u043e\u0432, \u0442.\u043a. \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043e\u043d\u0438 \u0441\u0445\u043e\u0436\u0438. \u0418\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 <a href=\"http:\/\/docs.masstransit-project.com\/en\/latest\/usage\/observers.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0438\u043b\u0438 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043d\u0430 <a href=\"https:\/\/github.com\/FSou1\/PlayWithMassTransit30\/tree\/master\/PlayWithMassTransit30\/Consumer\">Github<\/a>.<\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 pipeline \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u043c\u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0435\u0451 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043e \u0435\u0451 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7e5\/4e5\/d95\/7e54e5d95f434c93bb38012ad8a7a149.png\"\/><\/p>\n<p>  <a name=\"new-30\"><\/a><\/p>\n<h2>\u041d\u043e\u0432\u043e\u0435 \u0432 MassTransit 3.0<\/h2>\n<p>  \u0421 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u0441\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0432 2-\u0445 \u043e\u0431\u0437\u043e\u0440\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0430\u0432\u0442\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Chris Patterson\u2019\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430: <a href=\"https:\/\/lostechies.com\/chrispatterson\/2015\/02\/24\/masstransit-3-api-changes\/\">MassTransit 3 API Changes<\/a> \u0438 <a href=\"https:\/\/lostechies.com\/chrispatterson\/2015\/06\/16\/masstransit-v3-update\/\">MassTransit v3 Update<\/a>.<\/p>\n<p>  <a name=\"ps\"><\/a><\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0447\u0435\u0440\u0435\u0434\u044f\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043e\u0434\u043d\u0430\u043a\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 MassTransit, \u0437\u0430 \u0433\u0440\u0430\u043d\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0449\u0451 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u0430\u043a \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c, \u043f\u0435\u0440\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c (\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 NHibernate, MondoDb, EntityFramework), \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 (\u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Quartz), state machine (Automatonymous \u0438 Saga), \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (Log4Net, NLog), \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/FSou1\/PlayWithMassTransit30\">Github<\/a>.<\/p>\n<p>  <b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b:<\/b>  <\/p>\n<ol>\n<li><a href=\"http:\/\/docs.masstransit-project.com\/en\/latest\/overview\/backstory.html\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f MassTransit<\/a>.<\/li>\n<\/ol>\n<p><a name=\"poll\"><\/a><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/314080\/\"> https:\/\/habrahabr.ru\/post\/314080\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6cd\/ded\/a5e\/6cddeda5ee8f4d3cb5c9dbb557aef6b0.png\" align=\"right\" width=\"325\"\/>MassTransit \u044d\u0442\u043e open source \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C# \u0434\u043b\u044f .NET \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0449\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0448\u0438\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 SOA (service oriented architecture).<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 message broker \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c RabbitMq, Azure Service Bus \u0438\u043b\u0438 In-Memory \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 In-Memory \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-280250","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280250"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280250\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}