Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make error message more clear about where ordering must be enabled when publishing #293

Merged
merged 11 commits into from Jul 24, 2020
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