|
|
typedef std::map< std::string, std::string > | StringMap |
| |
◆ 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()
| MessageBuilder& pulsar::MessageBuilder::setContent |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
Set content of the message. The message contents will be managed by the system.
◆ setEventTimestamp()
| MessageBuilder& pulsar::MessageBuilder::setEventTimestamp |
( |
uint64_t |
eventTimestamp | ) |
|
Set the event timestamp for the message.
◆ 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: