Course Setup
Use Case
Messaging Basics
Consumer Subscription Types
API Internals for Message Integrity and Scaling
1 of 3

Apache Pulsar Producer Basics

Now that we have our client, we want to start writing messages to a topic on our cluster.  This is completed by creating a producer from our client.

Creation of a producer:

  1. Create an Apache Pulsar Client
  2. Producer attaches to a topic
  3. Producer does a lookup to determine which broker is assigned to it
  4. Producer publishes messages to broker for processing
  5. The broker returns a message acknowledging the send succeeded

Key features of a producer:

  • Many producers can (and should) share a client
  • Producers must have a unique name
  • Producers have an internal message buffer allowing for:
    • Transparently handle topics being moved to different brokers
    • Resend messages that fail
    • Ensure local message ordering
    • Ensure messages are published in order to the broker
    • Enable performance improvements through batching
  • Producers are designed to easily provide “at-least-once” message delivery
  • Messages are not removed from the local queue until they have been acknowledged by the broker