GithubHelp home page GithubHelp logo

bisk-messaging's Introduction

BISK Messaging Nuget Package

This is the solution containing the code for the BISK messaging abstraction. Currently the only implementation is RabbitMQ. There are test projects for synchronous and asynchronous publishing of messages as well as consuming the messages.

Building the Nuget Package

Warning
If you’re using a Mac and Visual Studio for Mac, you have to use the nuget tool to create the package. Please refer to this article: https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/nuget-multiplatform-libraries/existing-library
  1. Open the solution in Visual Studio 2019

  2. Right click the Messaging project and select Properties

  3. Navigate to the Package tab and adjust the Package version.

    Note
    On each change the version of the Nuget package needs to be increased otherwise the change is ignored by existing consumers of the package.

Adding the Nuget Package to a local Nuget Repo

  1. Make sure you have the nuget CLI installed

  2. Create a folder where the Nuget repo is supposed to be, e.g. on Windows d:\nuget_repo

  3. Deploy the Nuget package to the local repo:

    nuget <path to *.nuspec file> -source <path to nuget repo>

    Where <path to *.nuspec file> is the path and file name of the nuspec file created by Visual Studio, and <path to nuget repo> is the path to your local Nuget repo (e.g. d:\nuget_repo in my case)

Adding a Nuget Package from your local Nuget Repo

To add a Nuget package from your local Nuget repo to a project use the -source parameter in the dotnet add packag command:

dotnet add package bisk.messaging --version 1.0.2 --source d:\\nuget_repo
Warning
If you omit the --source parameter the dotnet tool will try to add the package from the public Nuget repo.

Testing the Messaging Code

Running the Synchronous Publisher and Consumer Pair

  1. Navigate into the solution folder

  2. Run the following command to start the application:

    docker-compose up --build -d

    This will start Rabbit MQ, a test publisher and a test consumer.

  3. Check that all services are up:

    docker-compose ps

    you should see:

            Name                       Command                  State                         Ports
     ---------------------------------------------------------------------------------------------------------------
    messaging_consumer_1    dotnet run EasyNetQ              Up
    messaging_publisher_1   dotnet run EasyNetQ              Up
    messaging_rabbitmq_1    docker-entrypoint.sh rabbi ...   Up (healthy)   15671/tcp, 0.0.0.0:15672->15672/tcp, ...
  4. Check and follow the logs to see if everything is ok:

    docker-compose logs --follow
  5. Tear down the app:

    docker-compose down -v

Running the Asynchronous Publisher and Consumer Pair

  1. Navigate into the solution folder

  2. Run the following command to start the application:

    docker-compose -f docker-compose-async.yml up --build -d

    This will start Rabbit MQ, aa async. test publisher and an async. test consumer.

  3. Check that all services are up:

    docker-compose -f docker-compose-async.yml ps

    you should see:

            Name                       Command                  State                         Ports
     ---------------------------------------------------------------------------------------------------------------
    messaging_consumer_1    dotnet run EasyNetQ              Up
    messaging_publisher_1   dotnet run EasyNetQ              Up
    messaging_rabbitmq_1    docker-entrypoint.sh rabbi ...   Up (healthy)   15671/tcp, 0.0.0.0:15672->15672/tcp, ...
  4. Check and follow the logs to see if everything is ok:

    docker-compose -f docker-compose-async.yml logs --follow
  5. Tear down the app:

    docker-compose -f docker-compose-async.yml down -v

bisk-messaging's People

Contributors

gnschenker avatar

Watchers

 avatar  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.