Skip to content
Permalink
Browse files
fix: Make error message more clear about where ordering must be enabl…
…ed when publishing (#293)

* feat: Add flow control support to publisher

* make suggested fixes

* chore: Remove note that ordering keys requires enablements.

* feat: Add support for server-side flow control

* Revert "chore: Remove note that ordering keys requires enablements."

This reverts commit 9c113c3.

* fix: Fix import order

* fix: Make error message more clear about where ordering must be enabled when publishing.
  • Loading branch information
kamalaboulhosn committed Jul 24, 2020
1 parent c8f981b commit f54ed0284a9c7e1a337481e13388397adfa33abf
Showing with 3 additions and 1 deletion.
  1. +3 −1 google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java
@@ -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));

0 comments on commit f54ed02

Please sign in to comment.