Sending message from Spring Kafka to Angular - spring

Is there a way to send message from Spring Kafka to Angular without using Websocket?
I use Spring as service side, and Angular as Client side.
When, I send a Kafka message from Spring server-side, I just want to transmit this message to Angular based client side.
I used this code in Spring-server to send message:
kafkaTemplate.send(topic, payload);
Actually my question is nearly same of this:
Actually my question is nearly same of this:
Receiving Kafka event on web browser real time

You can use Kafka REST API (proxy), it lets you to call Kafka directly from you client javascript and so you could consume/send events directly.
Have a look: https://github.com/confluentinc/kafka-rest

Related

Websocket using Stomp not able to receive subscribe data in client

I am using websocket with spring boot and stomp messaging protocol, where i created a HTML and using javascript event listener code to publish and subscribe the data. I can see publisher data in network tab and i can process the request in java as well. but subscriber data not showing. could any one help on this?

Building realtime messaging app with websockets in spring boot

I want to build a messaging backend service (similar to whatsapp) using spring boot and websockets.
I have look online at the examples of spring boot websockets.
I see how I would send a message to the server from client 1 using the #MessageMapping annotation.
However assuming client 2 (recipient of the message) is also connected to the server with websockets how would I send a message to them.
I have seen the sendToUser annotation however it seems to me that that sends the message to client 1 (the sender of the message).
Is there a map of client ids to websocket sessions or something so that if I know the message should go to (client 2). I can gethis active websocket session and then send him the message?

Example of RabbitMQ with RPC in Spring Integration

After make a search about different ways to implement it, im stuck.
What im looking for is to realize this example (https://www.rabbitmq.com/tutorials/tutorial-six-spring-amqp.html) with Spring Integration.
I had found interesting post as this (Spring integration with Rabbit AMQP for "Client Sends Message -> Server Receives & returns msg on return queue --> Client get correlated msg") but didn't help me with what i need.
My case mill be a system where a client call the "convertSendAndReceive" method and a server (basede on Spring Integration) will response.
Thanks
According to your explanation it sounds like Outbound Gateway on the Client side and Inbound Gateway on the Server side pair is what you need.
Spring Integration AMQP support provides those implementations for you with built-in correlation functionality: https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/amqp.html

Spring web services, JMS transport and replay-to

I need to send a soap message to a queue and wait for the response into another.
The correlationId in the second one (the response queue) is the message Id in the first the message send to the request queue.
I'd like to use spring-ws but I am out of ideas. Could you please give me some advice or small example?
You can use spring integration like this example https://github.com/snicoll/scratches/blob/master/jms-request-reply/src/main/java/net/nicoll/scratch/spring/boot/jms/sync/JmsRequestReply.java
Or spring jms to do request-reply http://docs.spring.io/spring/docs/current/spring-framework-reference/html/jms.html

Spring Stomp message send and receiptId

What is the right way to configure Spring StompBrokerRelay, to be able to create a simple java client which just publishes a messages, which are acknowledge by the server.
Spring client StompSession is returning Receiptable when sending message from client and it's possible to configure ReceiptTasks, but the receipt is never received from server.

Resources