Git Product home page Git Product logo

messaging-polyglot's Introduction

RabbitMQ ๐Ÿฐ Messaging Polyglot

by Luis Majano [email protected]

** This project was originally forked from Rob Harrop https://github.com/robharrop/presentations

Rabbit MQ Setup

In order to execute the examples you will need to have RabbitMQ Server installed: https://www.rabbitmq.com/ and for the STOMP example you will need to install the web-stomp plugin for RabbitMQ: https://www.rabbitmq.com/web-stomp.html

The Web STOMP plugin makes it possible to use STOMP over a WebSocket connection.

Docker Setup

However, we have also provide a docker-compose.yml file for doing all this for you ๐Ÿš€. You run docker-compose up in the root of this project and it will run a RabbitMQ server for you with all the necessary plugins installed.

The default credentials are rabbitmq for both username and password. You can change them in the docker compose file.

Traditional Setup

Invoke the sbin/rabbitmq-server shell script.

You can also start the server in detached mode with rabbitmq-server -detached, in which case the server process runs in the background.

You can customise the RabbitMQ environment by setting environment variables in $RABBITMQ_HOME/etc/rabbitmq/rabbitmq-env.conf. Server components may be configured, too, in the RabbitMQ configuration file located at $RABBITMQ_HOME/etc/rabbitmq/rabbitmq.config. Neither of these files exist after installation.

The broker creates a user rabbitmq with password rabbitmq. Unconfigured clients will in general use these credentials. By default, these credentials can only be used when connecting to the broker as localhost so you will need to take action before connecting from any other machine.

RabbitMQ Management Plugin

Install the managment plugin first rabbitmq-plugins enable rabbitmq_management

More information at: https://www.rabbitmq.com/management.html

RabbitMQ Admin URL

http://localhost:15672/

Credentials: guest:guest

RabbitMQ STOMP Plugin

Install the plugin:

rabbitmq-plugins enable rabbitmq_web_stomp

More information at: http://www.rabbitmq.com/web-stomp.html


Source Code

The source code is divided into consumers and producers. You can see many examples here for RabbitMQ implementations: https://www.rabbitmq.com/getstarted.html

Producers

  • Java - Native Java
  • CFML - ColdFusion (A web app)
  • CommandBox - CFML CLI based worker

Consumers

  • ColdFusion : Running a consumer via CFML asynchronously
  • CommandBox : CFML CLI based workers
  • Groovy : Running via Groovy
  • Java : Running via native Java consumers
  • Node : Running using amqplib and node
  • Stomp : Running via stompjs, websockets and RabbbitMQ

We will be using the Default Exchange which is the '' empty exchange, which is a direct exchange or you can use the amq.direct exchange as well.

The routing key used is stock.prices and since it is a direct exchange the queue name is also stock.prices

Stomp Plugin For RabbitMQ URL

http://127.0.0.1:15674/stomp

Valid destination types are: /temp-queue, /exchange, /topic, /queue, /amq/queue, /reply-queue/.

Use /queue for durable queues Use /amq/queque for default exchange and non-durable queues

messaging-polyglot's People

Contributors

lmajano avatar sigmaprojects avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

messaging-polyglot's Issues

loadJar() is not defined

Using the commandbox examples, the function loadJar() is undefined. I replaced it with classLoad() and it works.

I wonder if this createDynamicProxy call is correct?

https://github.com/lmajano/messaging-polyglot/blob/master/consumer/cfml/start.cfm

I wonder if the new lib.Consumer is correct? Since you placed the Consumer in models, should it not be
new models.Consumer? In your commandbox code Consumer is in the lib dir.
// Prepare a push consumer
consumerTask = createDynamicProxy(
new lib.Consumer( channel ),
[ "com.rabbitmq.client.Consumer" ]
);

And additionaly, I was wondering if I could integrate something like this in Coldbox.
I want to announce an interception directly in my consumer, so I can handle every incoming message in an interceptor. For this I need to inject my Consumer with the coldbox interceptor service.

So let's say
instead of new lib.Consumer(channel) a getInstance("Consumer").init(channel) or
better ?? without wirebox new lib.Consumer(channel, myInterceptorService) ??

By the way, nice work with RabbitMQ!!!

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.