Stomp + Spring + ZeroMQ for real-time - spring

I need to implement a real-time scenario via web sockets and ZeroMQ queue.
SockJS with Stomp in the client side
Spring MVC / Integration with #EnableWebSocketMessageBroker
Remote messaging queue with ZeroMQ
At this moement, I could connect client and Spring via web sockets but I need to add the magic of remote queues.
ZeroMQ is available from 2 remote URLs (one for publishing and another one for subscribing).
My question is: How can I implement ZeroMQ in order to stay listening subscribed URL or the publishing URL?
Additionally, this type of functionality is conceptually similar to Spring Integration Outbound Gateways which stay listening for the response. Is it possible to implement ZeroMQ via Spring integration?
Thank you

We have an open JIRA issue to add ZeroMQ support to Spring Integration.
But nothing is implemented yet; contributions are welcome!.

Related

Bridge between two WebSocket STOMP servers

We have an ActiveMQ server and our own API with WebSocket/STOMP service endpoint.
Is there a way to configure ActiveMQ to connect and subscribe to a topic in our API and then publish the messages in ActiveMQ?
If not, are there any other WebSocket/STOMP bridge components which could be used to achieve the same thing (subscribe to a topic in our API and post messages to a topic in ActiveMQ)?
The motivation of all this is... complicated.
ActiveMQ natively supports Camel routes. You could potentially use Camel's STOMP component to subscribe to your own STOMP endpoint and then send those messages to a local destination.

Difference between SockJS and ActiveMQ/RabbitMQ

I have recently developed a simple messaging application with Spring Boot and Spring Security. The application takes in 2 users - user A and user B. Once, user A performs a specific task a notification is sent to user B. Currently I am doing this by adding a Spring Messaging dependency and SockJS and it works great.
Here is where I am confused and hoping to receive some guidance. I realize there are many tutorials that speak about RabbitMQ and ActiveMQ. From what I understand, they are message brokers. May I ask what is the difference between SockJS and RabbitMQ/ActiveMQ? And do I need RabbitMQ/ActiveMQ in my current application together with SockJS?
SockJS is JavaScript based WebSocket client library that runs in a browser. It can be used to send messages to or receive messages from a broker.
Both RabbitMQ and ActiveMQ are message brokers, examples of message-oriented middleware. They both support WebSocket clients which use a messaging protocol (e.g. STOMP or AMQP). Brokers receive messages from and dispatch messages to clients.
You haven't really provided enough information to determine whether or not you actually need to use either RabbitMQ or ActiveMQ in your current application given that it's already working as it is.

Is there a way to use spring message brokers without Stompendpoints?

We have a use case to create websocket server. Mobile clients will connect to this websocket server. However mobile clients doesn't support stomp.
We would like to create a Java websocket server. spring does support websockets but it's heavily coupled with STOMP. we like to use Spring message broker concept here but because of Stomp, we are struck now. Is there anyway to overcome this and enable Spring websocket without STOMP but with Spring message broker concept?

How to update data in real-time

I have a small stock-market application with Spring boot and if any product updated I want to serve an updated product to the clients in realtime
does it make sense to use message queues like RabbitMQ and Sse(Server Sent Events) for this, or is there a more sensible solution?
Solution
Publish your updated data to some channel
Your clients should subscribe to that channel to get updated feed in real-time.
Tools
Use in-house setup for RabbitMQ, ActiveMQ, Kafka or other open-source tools and implement WebSocket (For Front end applications)
Use commercial service like Google Cloud PubSub
Readymade and fully packaged solution with supported SDK for backend and frontend, https://www.pubnub.com/.
For this you can use either of
Spring Integration
Web Sockets
JMS
Spring Integration is an implementation of Enterprise Integration Patterns and is ideal for asynchronous processing data at realtime.
However, looking at your scope, it is only about publisher-subscriber pattern. Hence can be solved with JMS.
With JMS the subscribers/consumers can register/de-register dynamically. Also it provides ways to have fall-backs and tracking.

Spring boot + Spring Integration Websocket adapter + Tibco JMS Server

I am working to build an application (Server side) which should pick message from tibco jms queue and then post that to a url at which the Client (written in angular js) will listen, and also from client when some actions are taken then the server should listen to those actions and perform respective actions.
I can read from tibco jms queue and can place it to a spring integration channel.
My question here is that, can this be build using spring integration websocket adaptors (inbound & outbound) ? If yes then can someone help me with some references for sending to the client and receiving from the client adaptor configurations ?
All the info about Spring Integration Websocket module is in the Reference Manual.
You also can take a look to a couple samples:
Simple plain Websockets
Chat based on STOMP protocol

Resources