vdenotaris
vdenotaris

Reputation: 13627

Messaging with Spring and external Message Brokers

My use case considers three actors:

The communication process is as follows:

  1. The Message Producer creates a message (by specifying a recipient) and then sends it to the Message Broker;
  2. The Message Broker relays the message to the Message Consumer;
  3. The Message Consumer receives the message, then delivers it to a specific user (by mapping recipient and username) by using a WebSocket.

Is it possible to implement this scenario?

Upvotes: 2

Views: 1409

Answers (1)

dectarin
dectarin

Reputation: 1006

Yes this scenario is definitely possible to implement. Is there any specific part of it that is troubling you? If you are not using the message consumer in your scenario to do anything else you could actually leave that part out and have the message be consumed directly on the browser-side.

This would involve using the STOMP protocol which most message brokers either support out of the box or can be enabled with a plugin (including RabbitMQ btw). On the browser-side then you can use StompJS. Rossen Stoyanchev gave a great talk on this at SpringOne2GX last year - slides are here...

http://rstoyanchev.github.io/s2gx2013-websocket-browser-apps-with-spring/#1

I hope this is useful for you.

Upvotes: 2

Related Questions