-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
api: pubsubliteIssues related to the googleapis/java-pubsublite API.Issues related to the googleapis/java-pubsublite API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.triage meI really want to be triaged.I really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
EventTime is useful in deciding when to advance high watermarks for streaming engines (Beam/Spark/Flink). Right now to set event time in a message published to Pub/Sub Lite, one needs to use a custom attribute of key "x-goog-pubsublite-event-time-timestamp-proto" and pass in a string using MessageTransforms.encodeAttributeEventTime():
import com.google.cloud.pubsublite.cloudpubsub.MessageTransforms;
// ..
String eventTime = MessageTransforms
.encodeAttributeEventTime(Timestamp.newBuilder().setSeconds(100).build());
ByteString data = ByteString.copyFromUtf8(message);
PubsubMessage pubsubMessage =
PubsubMessage.newBuilder()
.setData(data)
.putAttributes("x-goog-pubsublite-event-time-timestamp-proto", eventTime)
.build();
ApiFuture<String> future = publisher.publish(pubsubMessage);Is there a better way to surface EventTime from the protos?
Lines 114 to 144 in 343afbf
| * <pre> | |
| * An optional, user-specified event time. | |
| * </pre> | |
| * | |
| * <code>.google.protobuf.Timestamp event_time = 4;</code> | |
| * | |
| * @return Whether the eventTime field is set. | |
| */ | |
| boolean hasEventTime(); | |
| /** | |
| * | |
| * | |
| * <pre> | |
| * An optional, user-specified event time. | |
| * </pre> | |
| * | |
| * <code>.google.protobuf.Timestamp event_time = 4;</code> | |
| * | |
| * @return The eventTime. | |
| */ | |
| com.google.protobuf.Timestamp getEventTime(); | |
| /** | |
| * | |
| * | |
| * <pre> | |
| * An optional, user-specified event time. | |
| * </pre> | |
| * | |
| * <code>.google.protobuf.Timestamp event_time = 4;</code> | |
| */ | |
| com.google.protobuf.TimestampOrBuilder getEventTimeOrBuilder(); |
Metadata
Metadata
Assignees
Labels
api: pubsubliteIssues related to the googleapis/java-pubsublite API.Issues related to the googleapis/java-pubsublite API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.triage meI really want to be triaged.I really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.