Technical Interview Handbook

Technical Interview Handbook

  • Notes
  • About Me

›Basics

Introduction

  • Getting Started

Best Practices

  • Spring Project

Messaging

    Basics

    • Messaging Guide

    Rabbit MQ

    • Rabbit MQ Guide

Logging

  • ELK Guide

Concepts

  • GraphQL vs Rest

ORM

  • Hibernate Mapping Guide

Database

  • Mongo DB Guide

Enterprise Search

  • Apache Solr Guide

UI

  • ReactJS Guide

Build Tool

  • Maven Guide

Testing

  • Junit5 & Mockito Guide

CI/CD

  • Docker Desktop Installation
  • Docker Guide

About Me

  • About Me

Messaging Guide

Messaging

Why Message Queue?

  • Listen to Heartbeat of different applications
  • Persistence of the data
  • Load Balancing

Famous Use Case : Pizza Shop

  • Taking multiple orders in async mode
  • Giving delivery once pizza made
  • Steering orders to different store in case of heavy load

Different Messaging Types

  1. RMI(Remote Method Invocation)
  • Applications need to know remote application's method
  • Extremely tightly coupled
  • Synchronous
  1. JMS(Java Messaging Service)
  • Sender & Receiver knows message format and destination to use where message has been delivered
  • Guaranteed delivery
  • Loose coupling
  • Types supported : Synchronous & Asynchronous
  • Models supported for JMS Client: Point to Point, Publisher-Subscribe
  • Queues are for Point to Point Messaging : Sender -> Queue -> Receiver consumes -> Receiver sends acknowledgement. But there can be more than 1 receiver and sender to write in same queue
  • Topics are for Pub-Sub model : Sender Client -> Publishes to Topic -> Receiver Client subscribes to Topic -> Topic message delivered to Receviver client. Each consumer gets a copy of messages. No acknowledgement
  • Way of working : Application server creates server session which stores message in pool. Then server session create JMS Session.
  • Types of messages supported : Message, TextMessage, Bytemessage, OjectMessage, MapMessage
  • Famous Examples :IBM MQ, TIBCO
  • Famous JMS Providers : Active MQ, Rabbit MQ, JBoss MQ, HornetQ, IBM Websphere MQ
  • Components : Publisher, Subscriber, JMS Provider, Queue, Topic
  • JMS API Programming Model : ConnectionFactory -> Creates Connection -> Creates Session -> Message Producer/Consumer -> Send/Receive
  1. ActiveMQ
  • Open-source multi-protocol supported message broker
  • Written in Java language
  1. RabbitMQ
  • Open-source multi-protocol supported messaged broker
  • Written in Erlang language
  • Protocols supported : AMQP(Started from here), MQTT, and STOMP
  • Point to Point : Sender -> Queue -> Receiver
  • Pub-Sub : Sender -> Exchange(Based on binding key) -> Queue -> Receiver
  1. Apache Kafka
  • Streaming platform (Messaging + Distributed storage + Processing of data)
  • Pull-type messaging platform where consumers pull the messages from the broker
  • Straightforward routing approach that uses a routing key to send messages to a topic.
  1. Event Hub
  • Azure native messaging which helps in publishing events.
  1. IBM MQ/IBM Websphere MQ
  • Follows same approach as specified in JMS religiously(Queues & Topics)

References

  • JMS
  • IBM MQ
  • JMS & AMQP
  • IBM MQ , JMS with Spring Boot
  • Rabbit MQ
← Spring ProjectRabbit MQ Guide →
  • Why Message Queue?
  • Different Messaging Types
  • References
Technical Interview Handbook
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
User ShowcaseStack OverflowProject ChatTwitter
More
BlogGitHubStar
Copyright © 2020 anupama-sinha