You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose isReplicated() / getReplicatedFrom() on the public Message API #569
Expose replication-origin metadata on the public Message class so consumer logic can detect whether a received message was produced locally or geo-replicated from a remote cluster.
Requested API additions to include/pulsar/Message.h
/** * Check if this message was geo-replicated from another cluster. * * @return true if the message was replicated from a remote cluster, * false if it was produced locally*/boolisReplicated() const;
/** * Get the name of the cluster this message was replicated from. * * @return the source cluster name, or an empty string if the message * was produced locally (i.e. isReplicated() == false)*/const std::string& getReplicatedFrom() const;
Why this is straightforward to implement
MessageImpl already holds proto::MessageMetadata metadata (see lib/MessageImpl.h), which contains the replicated_from optional string field from the Pulsar binary protocol. The implementation would simply wrap:
Activity