Publish/Subscribe Pattern
Learn Publish/Subscribe Pattern (Core Messaging Patterns, Integration & Messaging Patterns) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What is Publish/Subscribe? In Publish/Subscribe (Pub/Sub) , a publisher sends a message to a named channel (a "topic"), and every subscriber currently listening on that topic receives its own copy of the message. This is the direct opposite of a queue's one-consumer-per-message behavior. Where It's Used • Broadcasting an event (e.g. "OrderShipped") to multiple independent interested services (billing, notifications, analytics) without the publisher knowing or caring who's listening. • Kafka topics and JMS Topic destinations are both real implementations of this pattern.