8000 fix: Make error message more clear about where ordering must be enabled when publishing by kamalaboulhosn · Pull Request #293 · googleapis/java-pubsub · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public ApiFuture<String> publish(PubsubMessage message) {
final String orderingKey = message.getOrderingKey();
Preconditions.checkState(
orderingKey.isEmpty() || enableMessageOrdering,
"Cannot publish a message with an ordering key when message ordering is not enabled.");
"Cannot publish a message with an ordering key when message ordering is not enabled in the "
+ "Publisher client. Please create a Publisher client with "
+ "setEnableMessageOrdering(true) in the builder.");

final OutstandingPublish outstandingPublish =
new OutstandingPublish(messageTransform.apply(message));
Expand Down
0