Skip to content

Commit f54ed02

Browse files
fix: Make error message more clear about where ordering must be enabled 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.
1 parent c8f981b commit f54ed02

File tree

1 file changed

+3
-1
lines changed
  • google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1

1 file changed

+3
-1
lines changed

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ public ApiFuture<String> publish(PubsubMessage message) {
233233
final String orderingKey = message.getOrderingKey();
234234
Preconditions.checkState(
235235
orderingKey.isEmpty() || enableMessageOrdering,
236-
"Cannot publish a message with an ordering key when message ordering is not enabled.");
236+
"Cannot publish a message with an ordering key when message ordering is not enabled in the "
237+
+ "Publisher client. Please create a Publisher client with "
238+
+ "setEnableMessageOrdering(true) in the builder.");
237239

238240
final OutstandingPublish outstandingPublish =
239241
new OutstandingPublish(messageTransform.apply(message));

0 commit comments

Comments
 (0)