suztomo commented on a change in pull request #13990:
URL: https://github.com/apache/beam/pull/13990#discussion_r577269240



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerAccessor.java
##########
@@ -150,14 +187,34 @@ private static SpannerAccessor 
createAndConnect(SpannerConfig spannerConfig) {
     ValueProvider<String> host = spannerConfig.getHost();
     if (host != null) {
       builder.setHost(host.get());
+      instantiatingGrpcChannelProvider.setEndpoint(host.get());
     }
     ValueProvider<String> emulatorHost = spannerConfig.getEmulatorHost();
     if (emulatorHost != null) {
       builder.setEmulatorHost(emulatorHost.get());
       builder.setCredentials(NoCredentials.getInstance());
+    } else {
+      String userAgentString = USER_AGENT_PREFIX + "/" + 
ReleaseInfo.getReleaseInfo().getVersion();
+      /* Workaround to setup user-agent string.
+       * InstantiatingGrpcChannelProvider will override the settings provided.
+       * The section below and all associated artifacts will be removed once 
the bug
+       * that prevents setting user-agent is fixed.
+       * https://github.com/googleapis/java-spanner/pull/747

Review comment:
       Thank you.




----------------------------------------------------------------
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:
[email protected]


Reply via email to