Giter VIP home page Giter VIP logo

sample_order_service_masstransit's Introduction

Sample Order Service using MassTransit Library

Pre-requisites

  • Docker Desktop for Windows

RabbitMq

  • clone the repo
  • run "docker-compose up" from the root folder of the project
  • Navigate to http://localhost:15672 to make sure that RabbitMq is running. Use default credentials to login (guest/guest)

Try the sample

  • Make sure to set multiple startup projects (OrderSample.Api and OrderSample.Console)
  • Start debugging
  • This should start the order service in a console app and the api in browser. You will see the swagger page.
  • try out the POST endpoint to create an order and POST /cancel to cancel an order
  • the app has no state / persistence

Solution Structure

OrderSample.Api

This is the Asp.Net Core API that implements the Order Service. It exposes two endpoints, one for submitting order and another for cancelling it. The submit order endpoint showcases the request / response communication pattern. The cancel order endpoint showcases the Command communication pattern.

OrderSample.Console

This is the console application that hosts the consumers. It's based on .NET Core Generic host and can be run as a console app, service or docker container. This is just the host and the logic for order service is in the OrderSample.OrderServices project.

OrderSample.Contracts

This is the shared library that specified the message contracts. MassTransit requires class names (including namespaces) to be same between producers / consumers.

OrderSample.OrderServices

It covers the main logic for consuming various messages. For simplicity, all consumers are implemented within the same library project but it can be decoupled into multiple libraries and / or hosted in seprate console apps as well.

sample_order_service_masstransit's People

Watchers

James Cloos avatar Wasif Ali 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.