Fixing spanner headers consistency issue.#2180
Conversation
Previously spanner client was sending (example valuess): user-agent: google-cloud-java/0.20.0-beta grpc-java-netty/1.2.0 x-goog-api-client: google-cloud-java/0.20.0-beta After the changes (example values): user-agent: grpc-java-netty/1.2.0, x-goog-api-client: gl-java/1.8.0_112-google-v7 gccl/1.2.1, gax/1.3.1 grpc/1.2.0
| DatabaseClient dbClient = spanner.getDatabaseClient(DatabaseId.of( | ||
| options.getProjectId(), instanceId, databaseId)); | ||
| // Queries the database | ||
| ResultSet resultSet = dbClient.singleUse().executeQuery(Statement.of("SELECT 1")); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Changes Unknown when pulling 61ae02f on vam-google:master into ** on GoogleCloudPlatform:master**. |
|
Addressed review feedback. PTAL. |
|
Changes Unknown when pulling 4644e73 on vam-google:master into ** on GoogleCloudPlatform:master**. |
| } | ||
| }; | ||
|
|
||
| public String getXGoogApiClientHeader(String libraryVersion) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| return String.format(Locale.US, | ||
| "gl-java/%s %s/%s", | ||
| getJavaVersion(), | ||
| firstNonNull(Runtime.class.getPackage().getImplementationVersion(), ""), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
Changes Unknown when pulling 6ad9dbd on vam-google:master into ** on GoogleCloudPlatform:master**. |
bjwatson
left a comment
There was a problem hiding this comment.
Generally looks okay to me. I have just one question.
| */ | ||
| @InternalApi | ||
| public String getXGoogApiClientHeader(String libraryVersion) { | ||
| return String.format(Locale.US, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…#2180) * chore: Update generation configuration at Sat Jul 5 02:33:24 UTC 2025 * chore: generate libraries at Sat Jul 5 02:33:51 UTC 2025
Previously spanner client was sending (example valuess):
After the changes (example values):
Also added missing spanner quickstart sample and updated README respectively.
The quickstart sample was taken from https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/spanner/cloud-client/src/main/java/com/example/spanner/QuickstartSample.java