You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/01/13 16:37:33 UTC

[GitHub] [camel] omarsmak commented on a change in pull request #4877: CAMEL-16022: Add message ordering to Google PubSub

omarsmak commented on a change in pull request #4877:
URL: https://github.com/apache/camel/pull/4877#discussion_r556654222



##########
File path: components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
##########
@@ -129,6 +132,15 @@ private Publisher buildPublisher(String topicName) throws IOException {
             CredentialsProvider credentialsProvider = NoCredentialsProvider.create();
             builder.setChannelProvider(channelProvider).setCredentialsProvider(credentialsProvider);
         }
+        if (googlePubsubEndpoint.isMessageOrderingEnabled()) {
+            builder.setEnableMessageOrdering(true);
+            if (StringHelper.trimToNull(googlePubsubEndpoint.getPubsubEndpoint()) != null) {
+                builder.setEndpoint(googlePubsubEndpoint.getPubsubEndpoint());
+            } else {
+                LOG.warn("In conjunction with enabeling message ordering the pubsubEndpoint should be set. "
+                         + "Message ordering is only garantied when send to the same region.");

Review comment:
       typo
   ```suggestion
                            + "Message ordering is only guaranteed when send to the same region.");
   ```

##########
File path: components/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubComponent.java
##########
@@ -129,6 +132,15 @@ private Publisher buildPublisher(String topicName) throws IOException {
             CredentialsProvider credentialsProvider = NoCredentialsProvider.create();
             builder.setChannelProvider(channelProvider).setCredentialsProvider(credentialsProvider);
         }
+        if (googlePubsubEndpoint.isMessageOrderingEnabled()) {
+            builder.setEnableMessageOrdering(true);
+            if (StringHelper.trimToNull(googlePubsubEndpoint.getPubsubEndpoint()) != null) {
+                builder.setEndpoint(googlePubsubEndpoint.getPubsubEndpoint());

Review comment:
       I am bit confused here, why do you need to override the endpoint here if the message ordering is enabled? And also it looks the endpoint could be overriden [here](https://github.com/apache/camel/pull/4877/files#diff-fab91f6f43de3fd75a1134f3fe2fda9b52f3d78a45336ab56a758eae05fba1edR129) and hence I don't think this option is needed. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org