
Producers send messages to brokers synchronously (sync) or asynchronously (async). ProducersĪ producer is a process that attaches to a topic and publishes messages to a Pulsar broker. The default value is 5 MB.įor more information on Pulsar message contents, see Pulsar binary protocol. Any messages received larger than this value are rejected. # The max size of the netty frame (in bytes). You can configure the max size of a message with the following configurations. If you set the key as other types, for example, an AVRO object, the key is sent as bytes, and it is difficult to get the AVRO object back on the consumer. When you set TypedMessageBuilder, set the key as a string. You can set message properties such as the message key, message value with TypedMessageBuilder. If nothing is set to event time, the value is 0. For example, applications attach a timestamp on when the message is processed. The timestamp is automatically applied by the producer.Īn optional timestamp attached to a message by applications. The timestamp of when the message is published. The sequence ID of the message is its order in that sequence. If you do not specify a producer name, the default name is used.Įach Pulsar message belongs to an ordered sequence on its topic. The name of the producer who produces the message.

Messages are optionally tagged with keys, which is useful for things like topic compaction.Īn optional key/value map of user-defined properties. All Pulsar messages contain raw bytes, although message data can also conform to data schemas. The following table lists the components of messages. Retained messages are discarded only when a consumer acknowledges that those messages are processed successfully. When a subscription is created, Pulsar retains all messages, even if the consumer is disconnected.

Consumers subscribe to those topics, process incoming messages, and send an acknowledgement when processing is complete. In this pattern, producers publish messages to topics. Pulsar is built on the publish-subscribe pattern (often abbreviated to pub-sub).
