@PublicEvolving public class PulsarMessageBuilder<T> extends Object
TypedMessageBuilder
wrapper for providing the required method for end-users.Constructor and Description |
---|
PulsarMessageBuilder() |
Modifier and Type | Method and Description |
---|---|
PulsarMessage<T> |
build() |
PulsarMessageBuilder<T> |
disableReplication()
Method wrapper of
TypedMessageBuilder.disableReplication() . |
PulsarMessageBuilder<T> |
eventTime(long eventTime)
Method wrapper of
TypedMessageBuilder.eventTime(long) . |
PulsarMessageBuilder<T> |
key(String key)
Property
TypedMessageBuilder.key(String) . |
PulsarMessageBuilder<T> |
orderingKey(byte[] orderingKey)
Method wrapper of
TypedMessageBuilder.orderingKey(byte[]) . |
PulsarMessageBuilder<T> |
properties(Map<String,String> properties)
Method wrapper of
TypedMessageBuilder.properties(Map) . |
PulsarMessageBuilder<T> |
property(String key,
String value)
Method wrapper of
TypedMessageBuilder.property(String, String) . |
PulsarMessageBuilder<T> |
replicationClusters(List<String> replicationClusters)
Method wrapper of
TypedMessageBuilder.replicationClusters(List) . |
PulsarMessageBuilder<T> |
sequenceId(long sequenceId)
Method wrapper of
TypedMessageBuilder.sequenceId(long) . |
PulsarMessageBuilder<T> |
value(org.apache.pulsar.client.api.Schema<T> schema,
T value)
Method wrapper of
TypedMessageBuilder.value(Object) . |
public PulsarMessageBuilder<T> orderingKey(byte[] orderingKey)
TypedMessageBuilder.orderingKey(byte[])
.public PulsarMessageBuilder<T> key(String key)
TypedMessageBuilder.key(String)
. This property would also be used in KeyHashTopicRouter
.public PulsarMessageBuilder<T> eventTime(long eventTime)
TypedMessageBuilder.eventTime(long)
.public PulsarMessageBuilder<T> value(org.apache.pulsar.client.api.Schema<T> schema, T value)
TypedMessageBuilder.value(Object)
. You can pass any schema for
validating it on Pulsar. This is called schema evolution. But the topic on Pulsar should bind
to a fixed Schema
. You can't have multiple schemas on the same topic unless it's
compatible with each other.value
- The value could be null, which is called tombstones message in Pulsar. (It will
be skipped and considered deleted.)public PulsarMessageBuilder<T> property(String key, String value)
TypedMessageBuilder.property(String, String)
.public PulsarMessageBuilder<T> properties(Map<String,String> properties)
TypedMessageBuilder.properties(Map)
.public PulsarMessageBuilder<T> sequenceId(long sequenceId)
TypedMessageBuilder.sequenceId(long)
.public PulsarMessageBuilder<T> replicationClusters(List<String> replicationClusters)
TypedMessageBuilder.replicationClusters(List)
.public PulsarMessageBuilder<T> disableReplication()
TypedMessageBuilder.disableReplication()
.public PulsarMessage<T> build()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.