Code Monkey home page Code Monkey logo

rebus.headerconverterextensions's Introduction

Rebus.HeaderConverterExtensions

NuGet version Build Status MIT license

An extension library for Rebus to convert Rebus headers to/from a set of standardized headers. It will allow non-Rebus implementations, and other non-dotnet code, interact with Rebus.

Message Headers

Messages headers give basic information about the message. This library offers an extension tool to provide your own default set of standard headers with Rebus. Using a set of standardized headers will allow for different service implementations to communicate.

Default Header Standard

This extension library comes with a default header standard, which is possible to extend or override.

Header Key Header Value Type Description
STANDARD.MessageId Guid Unique message id.
STANDARD.CorrelationId Guid Unique message correlation id.
STANDARD.ReplyToAddress String Which address/queue to send replies.
STANDARD.OriginatingAddress String Originating address/queue.
STANDARD.ContentType String Content type, commonly application/json;charset=utf8.
STANDARD.MessageType String Optional contract namespace of message type, commonly <CONTRACT_NAMESPACE>.<CONTRACT_TYPE>.
STANDARD.Intent String Message intent - command or event.
STANDARD.TimeSent String UTC timestamp at what time the message was sent, commonly 07/22/2019 11:40:19 - (month/day/year hour:min:sec).
STANDARD.ErrorDetails String Error details attached in case of an exception.
STANDARD.SourceQueue String Source queue of a message that has been forwarded to an error queue after it has failed.

Example

In short, activate the header converter extension with the AddStandardHeaderConverter() method.

using Rebus.HeaderConverterExtensions;

var handler = new BuiltinHandlerActivator();
var bus = Configure.With(handler)
    .Options(optionsConfigure =>
    {
        // Add standard header converter extension.
        // The extension will convert incoming messages with standard headers to rebus headers,
        // and convert rebus headers to standard headers on outgoing messages.
        optionsConfigure.AddStandardHeaderConverter();
    })
    .Transport(t => ...
    .Start();

Have a look at a more detailed example here:

The example implements a dotnet service with Rebus and a python service with Pika. The services communicates over AMQP using a RabbitMq message broker.

Test the example with Docker:

pip install DockerBuildManagement
  • Build and run example:
dbm -swarm -start
dbm -build -run example
dbm -swarm -stop

Development

Install Docker and DockerBuildManagement to build, test and publish the solution with Docker.

pip install DockerBuildManagement

Deploy RabbitMq With Docker Swarm:

dbm -swarm -start

Build & Test Solution:

dbm -build -test

Stop RabbitMq Running On Docker Swarm:

dbm -swarm -stop

Build & Export Nuget:

dbm -build -run dotnet

Publish Nuget:

dbm -publish dotnet

Otherwise, install Dotnet Core to continue development.

rebus.headerconverterextensions's People

Contributors

hansehe avatar

Stargazers

 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.