Giter Club home page Giter Club logo

routing-key-example's Introduction

Routing Key Example

Summary Build Status

This example demonstrates the usage of routing key when working with Spring Cloud Stream.

Execute

To test this service create start a RabbitMQ and create the two vhosts accountancy and crm. Afterwards you can simple execute this service with

$> ./gradlew bootRun

Create needed vhosts

As mentioned you for this example you need a RabbitMQ with the vhosts 'accountancy' and 'crm'. Therefore simply start a local RabbitMQ, e.q. with docker:

docker run -d --hostname my-rabbit --name some-rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management

This will create a RabbitMQ container with management console. The management console is bound to the port 15672 and RabbitMQ is bound to 5672. The default user and password is guest/guest. You need this credentials to access the management api, see authorization header in the next examples. To create a new vhost you can send the next curl statement against the management api. This will create a new vhost 'accountancy'.

curl -X PUT \
  http://localhost:15672/api/vhosts/accountancy \
  -H 'authorization: Basic Z3Vlc3Q6Z3Vlc3Q=' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json'

Accessing this vhost is only possible with the correct permissions. Assign with the following request all permission to user guest:

curl -X PUT \
  http://localhost:15672/api/permissions/accountancy/guest \
  -H 'authorization: Basic Z3Vlc3Q6Z3Vlc3Q=' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"configure":".*","write":".*","read":".*"}'

Repeat both steps for the vhost 'crm'.

Important Links

routing-key-example's People

Contributors

dex-abi 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.