Q: What is Spring Cloud Stream? What is the need for it?
In previous examples we had implemented examples for integrating Spring Boot Applications with
Messaging Systems like Apache Kafka
. If you look at these examples these
required a lot of configuration code which was Broker specific. For example in case of RabbitMQ
integration with Spring Boot
we had to write code to create AmqpTemplate Template and Bindings.
So if tomorrow the Messaging System changes we will also need to make application code changes.
Spring Cloud helps solve this problem using Spring Cloud Stream. Using Spring Cloud Stream we can develop
applications where we do not need to specify the implementation details of the messaging system we want to use. We just need to specify the
required binding dependencies and Spring Cloud Stream will the integrate the messaging systems to Spring Boot Application.
Spring Cloud Stream Tutorial - Publish Message to RabbitMQ Simple Example
Spring Cloud Stream Tutorial - Consume Message from RabbitMQ Simple Example
Q: What are the types of exchanges available in RabbitMQ?
There are 4 types of exchanges available in RabbitMQ.
Q: How to verify RabbitMQ version?
- Direct - Based on the routing key a message is sent to the binding queue having the same routing key. The routing key of exchange and the binding queue
have to be an exact match.
Fanout - The message is routed to all the available bounded queues. The routing key if provided is completely ignored. So this is a kind of publishe-subscribe
Topic - Here again the routing key is made use of. But unlike in direct exchange type, here the routing key of the exchange and the bound queues should not
necessarily be an exact match. Using regular expressions like wildcard we can send the exchange to multiple bound queues.
Headers - In this type of exchange the routing queue is selected based on the criteria specified in the headers instead of the routing key. This is similar
to topic exchange type, but here we can specify complex criteria for selecting routing queues.
sudo rabbitmqctl status
Q: How to delete all RabbitMQ queues?
Q: Does RabbitMQ have any concept of message priority?
RabbitMQ does have concept of priority-
Q: What is STOMP??
We can define the queue's priority range at the time the queue is created
Messages where priority is not set get a priority of 0
Messages with a numeric priority higher than the maximum set on the queue get the highest priority the queue supports
STOMP is a simple text-oriented messaging protocol used by our UI Client(browser)
to connect to enterprise message brokers.
Clients can use the SEND or SUBSCRIBE commands to send or subscribe for messages
along with a "destination" header that describes what the message is about and who should receive it.
It defines a protocol for clients and servers to communicate with messaging semantics. It does not define any implementation details,
but rather addresses an easy-to-implement wire protocol for messaging integrations.
The protocol is broadly similar to HTTP, and works over TCP using the following commands:
Q: How to implement Chat Application using Spring Boot + WebSocket + RabbitMQ?
Q: How to implement Retry and Error Handling for RabbitMQ?
Spring Boot Interview Questions
Apache Camel Interview Questions
Drools Interview Questions
Java 8 Interview Questions
Enterprise Service Bus- ESB Interview Questions.
JBoss Fuse Interview Questions
Angular 2 Interview Questions