Web browser for rabbitmq - stomp web plugin vs nodejs amqp

I am trying to decide if I will connect from the Internet to rabbitmq through:

Solution 1. Plugin Rabbitmq stomp + Rabbitmq web stomp plugin + Sockjs

Solution 2. Rabbitmq + nodejs through the amqp nodejs plugin

Scenario:

a) I have one web application that signed the queue b) I have one java application that writes to this queue c) I have one browser open with solution 1 and the other with solution 2

I tested both of them:

when I send consecutive 10,000 messages, solution 2 is much faster than solution 1. Solution 2 never loses touch. Solution 1 in most cases loses the connection at a random time (before it receives each message).

Questions:

  • Is there any limited configuration that I can update in solution 1?

  • Problem Solution 1 is related to: Sockjs? Stomp plugin? Stomp network plugin? All of them? I don’t understand why, if I add nodejs in the middle, it is much faster than the built-in erlang plugin in rabbitmq (plugins for creating rabbit / stomp / rabbitmq).

    Note: the stomp plugin or the network stomp plugin never dies. He always continues to listen to his ports.

  • My simple explanation is that the browser cannot handle so many consecutive messages, and nodejs does it pretty well, and the bunny web does not work. But this is just an assumption. It's right? If so, how can I solve it?

  • Solution 1 should not be better (in latency too) than solution 2?

Note. If I add to the publisher a difference of 5 milliseconds between sending each message, this problem will disappear and solution 1 will work as solution 2 (for 10,000 messages).

Thanks for any answer.

Best wishes,

Eduardo

+4
source share
1 answer

You are comparing the server (node.js) and the borwser clients using different protocols, of course they are very different! The STOMP protocol is useful for providing a simple and simple client-side only for messaging, for example, the JS browser.

I think solution 1 can vary greatly depending on the browser and the type of connection. SockJS uses: XHR, WebSocket, IFrame ...

0
source

Source: https://habr.com/ru/post/1433878/


All Articles