Coder Social home page Coder Social logo

sagas-demo's Introduction

Demonstração do uso de Sagas com NServiceBus

Essa demonstração foi apresentada por mim no meetup do Brasil .NET, na palestra Lidando com fluxos complexos com o uso de Sagas, NServiceBus e RabbitMQ.

Para executar essa demonstração na sua máquina, alguns pré-requisitos precisam ser atendidos.

Visite e se inscreva no meu canal no YouTube (https://youtube.com/donetbr) para assistir a palestra.

Pré-Requisitos

  • SQL Server

No código-fonte, estou usando a conexão com o SQLEXPRESS, mas pode ser qualquer instância. Defina no arquivo app.config.

Instale o RabbitMQ na sua máquina. Se quiser abrir o painel de gerenciamento, execute o comando:

rabbitmq-plugins enable rabbitmq_management

Mais detalhes aqui

A instalação da suite da Particular Software é opcional, mas necessária se você quiser observar as mensagens que trafegam na saga.

OBS: se você não quiser visualizar as mensagens e o fluxo de execução da saga, remova o trecho abaixo do app.config

  <configSections>
    <section name="AuditConfig"
             type="NServiceBus.Config.AuditConfig, NServiceBus.Core"/>
  </configSections>
  <AuditConfig QueueName="audit"
               OverrideTimeToBeReceived="00:10:00"/>
  <appSettings>
    <add key="ServiceControl/Queue" value="Particular.ServiceControl"/>
  </appSettings>

e o seguinte trecho do Program.cs:

endpointConfiguration.SagaPlugin("OpenPlatform.ServiceControl");

Configuração do ServiceControl

Para capturar as mensagens trafegadas no NserviceBus, configure o ServiceControl da seguinte maneira:

  • General/Name: mantenha Particular.ServiceControl
  • Transport Configuration/Transport: selecione RabbitMQ
  • Transport Configuration/Transport Connection String: host=localhost

sagas-demo's People

Contributors

heber-uux avatar heberop avatar

Watchers

Hector Figueroa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.