Skip to content
Advertisement

Connect VueJS to RabbitMQ [closed]

I’m building a web application using VueJS. The application should act as a message producer and should send messages to a RabbitMQ. Is there a best practice on how to implement the components for this?

Edit: I believe that this is not solved and RabbitMQ allows websocket connections for protocols other than AMQP, namely MQTT and STOMP are supported using plugins written by RabbitMQ team.
These plugins enable websocket transfer protocol and enable operation with these messaging protocols.
Source: https://www.rabbitmq.com/web-mqtt.html

Advertisement

Answer

Rabbitmq is based on the amqp protocol, which is not designed to be accessible directly from a browser/webapp.

A browser can talk to a server using http or websockets.

Then, your server can talk to rabbitmq using an amqp client.

This is an example of stack achieving this:

-your vue app send http request to a node/express server -your node/express server translate the request from http call (express route) to rabbit queue using the node amqp client library.

-rabbit mq process the messages note serveur can wait for the rabbit response, or not.

Note that here, your webapp manage the server connection (address etc) and your server manage the configuration of the rabbitmq connection.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement