Event-driven asynchronous messaging service that decouples senders and receivers. Allows for secure and highly available communication between independently written applications.
Pub/Sub is an event-driven asynchronous messaging service that decouples senders (producing events) and receivers (processing events). It allows for secure and highly available communication between independently written applications.
Subscribers actively request messages from the subscription. They have to explicitly acknowledge messages after successful processing. This provides more control over the message consumption rate and is suitable for work queues where guaranteed processing is crucial.
Pub/Sub pushes messages to a registered HTTP endpoint (webhook) on the subscriber. A successful HTTP 200 OK response acts as the acknowledgement. Pub/Sub automatically manages the delivery rate based on the subscriber's response times.
Combines multiple messages into a single publish request, optimizing throughput and reducing cost per message.
subscription/num_undelivered_messages: High counts indicate potential subscriber issues (processing too slow, crashes, etc.).subscription/byte_cost: Track message size to optimize costs and identify large messages that might impact performance.topic/send_message_operation_count: Monitor publish rates to detect anomalies like sudden spikes or drops that could indicate publisher problems or unusual traffic.subscription/oldest_unacked_message_age: High values signify processing delays in subscribers. Crucial for time-sensitive applications.topic/publish_latency: Tracks publish latency, helpful for identifying publisher-side bottlenecks.subscription/pull_request_count: A high volume may indicate inefficient pull configuration.topic/send_message_error_count: Publishing errors to identify issues with publisher code or topic availability.subscription/ack_message_operation_count: Compare against published messages to ensure messages are being processed and acknowledged properly. A significant mismatch could indicate message loss or subscriber problems.Q1. What is the main difference between Push and Pull subscriptions?
Q2. How does persistence differ between Kafka and Pub/Sub?
Q3. What is a Dead Letter Queue used for?