|
typedef std::map< std::string, std::string > | StringMap |
|
|
const char * | data () const |
|
std::size_t | size () const |
|
◆ build()
Message pulsar::MessageBuilder::build |
( |
| ) |
|
Finalize the immutable message
◆ create()
create a empty message, with no properties or data
◆ disableReplication()
MessageBuilder & pulsar::MessageBuilder::disableReplication |
( |
bool |
flag | ) |
|
Do not replicate this message
- Parameters
-
flag | if true, disable replication, otherwise use default replication |
◆ setAllocatedContent()
MessageBuilder & pulsar::MessageBuilder::setAllocatedContent |
( |
void * |
data, |
|
|
size_t |
size |
|
) |
| |
Set content of the message to a buffer already allocated by the caller. No copies of this buffer will be made. The caller is responsible to ensure the memory buffer is valid until the message has been persisted (or an error is returned).
◆ setContent() [1/4]
Set the key value content of the message
- Parameters
-
data | the content of the key value. |
◆ setContent() [2/4]
MessageBuilder & pulsar::MessageBuilder::setContent |
( |
const std::string & |
data | ) |
|
◆ setContent() [3/4]
MessageBuilder & pulsar::MessageBuilder::setContent |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
Set content of the message. The given data is copied into message.
◆ setContent() [4/4]
MessageBuilder & pulsar::MessageBuilder::setContent |
( |
std::string && |
data | ) |
|
Set the content of the message
- Parameters
-
data | the content of the message. The given data is moved into message. |
◆ setDeliverAfter()
MessageBuilder & pulsar::MessageBuilder::setDeliverAfter |
( |
const std::chrono::milliseconds |
delay | ) |
|
Specify a delay for the delivery of the messages.
- Parameters
-
delay | the delay in milliseconds |
◆ setDeliverAt()
MessageBuilder & pulsar::MessageBuilder::setDeliverAt |
( |
uint64_t |
deliveryTimestamp | ) |
|
Specify the this message should not be delivered earlier than the specified timestamp.
- Parameters
-
deliveryTimestamp | UTC based timestamp in milliseconds |
◆ setEventTimestamp()
MessageBuilder & pulsar::MessageBuilder::setEventTimestamp |
( |
uint64_t |
eventTimestamp | ) |
|
Set the event timestamp for the message.
◆ setOrderingKey()
MessageBuilder & pulsar::MessageBuilder::setOrderingKey |
( |
const std::string & |
orderingKey | ) |
|
set ordering key used for key_shared subscriptions
- Parameters
-
the | ordering key for the message |
◆ setPartitionKey()
MessageBuilder & pulsar::MessageBuilder::setPartitionKey |
( |
const std::string & |
partitionKey | ) |
|
set partition key for message routing and topic compaction
- Parameters
-
hash | of this key is used to determine message's topic partition |
◆ setProperties()
MessageBuilder & pulsar::MessageBuilder::setProperties |
( |
const StringMap & |
properties | ) |
|
Add all the properties in the provided map
◆ setProperty()
MessageBuilder & pulsar::MessageBuilder::setProperty |
( |
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
Sets a new property on a message.
- Parameters
-
name | the name of the property |
value | the associated value |
◆ setReplicationClusters()
MessageBuilder & pulsar::MessageBuilder::setReplicationClusters |
( |
const std::vector< std::string > & |
clusters | ) |
|
override namespace replication clusters. note that it is the caller's responsibility to provide valid cluster names, and that all clusters have been previously configured as topics.
given an empty list, the message will replicate per the namespace configuration.
- Parameters
-
clusters | where to send this message. |
◆ setSequenceId()
MessageBuilder & pulsar::MessageBuilder::setSequenceId |
( |
int64_t |
sequenceId | ) |
|
Specify a custom sequence id for the message being published.
The sequence id can be used for deduplication purposes and it needs to follow these rules:
-
sequenceId >= 0
-
Sequence id for a message needs to be greater than sequence id for earlier messages:
sequenceId(N+1) > sequenceId(N)
-
It's not necessary for sequence ids to be consecutive. There can be holes between messages. Eg. the
sequenceId
could represent an offset or a cumulative size.
- Parameters
-
sequenceId | the sequence id to assign to the current message |
- Since
- 1.20.0
The documentation for this class was generated from the following file: