RxJS websocket (UI) & Stomp using Spring-websocket (backend) can work fine? - websocket

I followed spring tutorial and using Stomp, sockJS (sub-protocol build on top of websocket).
I have very limited knowledge of front end and front end architect is not fine with stomp and socksJS, as his argument is why you want to add new libraries like sockjs.min.js and stomp.min.js, rather than using the existing library RxJS which also gives websocket.
Q: Will the stomp(spring) on backend and RxJS websocket on front end(UI client) solution work?
Note: Its not much traffic to start with, as trying this for few use cases

As long as your front end is using STOMP over WebSocket it doesn't really matter what client implementation you use, it should work with Spring. There are STOMP clients for RxJS and STOMP clients that don't use RxJS.

Related

How to consume external websocket API in Apache Camel since ahc-ws deprecate?

ahc and ahc-ws (Async Http Client) components have been deprecated in Apache camel version 3.16: https://issues.apache.org/jira/browse/CAMEL-17667.
Is there an alternative for ahc-ws? The component was very easy to use to consume external websockets API.
Other libraries like Jetty, Undertow, Atmosphere, don't seem to offer this kind of features. I have not been able to configure them and the documentation remains unclear. They only provide the server part.
For the websocket-jsr356 component, I can't configure the component to consume a WebSockets over SSL API (wss). The library seems to support only classic websocket (ws).
I looked for alternatives on the camel doc, examples on github but I didn't find anything.
Is there a viable alternative to ahc-ws to consume external websocket APIs simply with camel?
Thanks a lot
Looks like it's not deprecated yet. There is just a suggestion for that. ahc-wss is very useful currently and there is no viable alternative for the same. websocket component requires tedious tweaking of secure storage parameters and is just kills the purpose of wss. I hope they don't deprecate ahc-wss without a proper replacement though.

Spring WebFlux with socket.io capabilities

I'm playing around with Spring WebFlux and how to do async I/O in Java but it seems I need to set up a lot of boilerplates for managing websockets. For example, very common operations need to be re-implemented by hand:
websocket connect/disconnect
message broadcasting (to a list or all connected sockets)
gathering websockets in rooms
Is there any library (mature or in-development) to abstract complexity of managing websockets with
Spring WebFlux ? I'm looking for similar capabilities/API of the wonderful socket.io.
I took a (very brief) look at RSocket, it looks promising but still at a lower-level than socket.io for NodeJS.
Any help/guidelines would be greatly appreciated.

Difference between websocket and vertx

I've been recently learning about vertx and websocket.
What I understood that you can have real-time application using them, but I didn't understand the difference between them
A websocket lets you push messages from server to client and vice-versa, encouraging the publish-subscribe methodology. Then what is vertx doing? It acts as an event bus and also encourages publish-subscribe model.
I can be completely wrong in my analysis, hence please correct me and I'll be glad. thanks.
WebSockets is a stateful protocol, usually used to communicate between clients and servers.
Vert.x is a server-side framework, which has a very good support for WebSockets.
You don't have to use WebSockets with Vert.x. But if you do want to use WebSockets, Vert.x is a great option.
Here's an article I wrote a few months ago about both:
https://medium.com/#alexey.soshin/playing-ping-pong-over-websockets-with-vert-x-447c634c6c87

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.

Stomp + Spring + ZeroMQ for real-time

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!.

Resources