Skip to content

Commit fd0984b

Browse files
authored
Merge branch 'master' into long-semaphore
2 parents 822c747 + 3d87984 commit fd0984b

7 files changed

Lines changed: 21 additions & 12 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,9 @@ This client is supported on Mac OS X, Windows and Linux (excluding Android and A
822822
Google Cloud Platform environments currently supported include GCE, GKE and GAE Flex.
823823
GAE Standard is not currently supported.
824824
825+
Spring Boot users : Native Tomcat is not currently supported. Please use [embedded Jetty](https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html#howto-use-jetty-instead-of-tomcat)
826+
to get your application working with this client.
827+
825828
Testing
826829
-------
827830

google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateSubscriptionAndConsumeMessages.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
public class CreateSubscriptionAndConsumeMessages {
3434

3535
public static void main(String... args) throws Exception {
36-
TopicName topic = TopicName.create("test-project", "test-topic");
37-
SubscriptionName subscription = SubscriptionName.create("test-project", "test-subscription");
36+
TopicName topic = TopicName.create("my-project-id", "my-topic-id");
37+
SubscriptionName subscription = SubscriptionName.create("my-project-id", "my-topic-id");
3838

3939
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
4040
subscriptionAdminClient.createSubscription(subscription, topic, PushConfig.getDefaultInstance(), 0);
@@ -44,7 +44,7 @@ public static void main(String... args) throws Exception {
4444
new MessageReceiver() {
4545
@Override
4646
public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
47-
System.out.println("got message: " + message.getData().toStringUtf8());
47+
System.out.println("Received message: " + message.getData().toStringUtf8());
4848
consumer.ack();
4949
}
5050
};

google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/CreateTopicAndPublishMessages.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
public class CreateTopicAndPublishMessages {
3535

3636
public static void createTopic() throws Exception {
37-
TopicName topic = TopicName.create("test-project", "test-topic");
37+
TopicName topic = TopicName.create("my-project-id", "my-topic-id");
3838
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
3939
topicAdminClient.createTopic(topic);
4040
}
4141
}
4242

4343
public static void publishMessages() throws Exception {
4444
// [START publish]
45-
TopicName topicName = TopicName.create("test-project", "test-topic");
45+
TopicName topicName = TopicName.create("my-project-id", "my-topic-id");
4646
Publisher publisher = null;
4747
List<ApiFuture<String>> messageIdFutures = new ArrayList<>();
4848

google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets/SubscriberSnippets.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ private void createSubscriber() throws Exception {
8686
MessageReceiver receiver = new MessageReceiver() {
8787
@Override
8888
public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
89-
// handle incoming message, then ack or nack the received message
90-
// ...
89+
// handle incoming message, then ack/nack the received message
90+
System.out.println("Id : " + message.getMessageId());
91+
System.out.println("Data : " + message.getData().toStringUtf8());
9192
consumer.ack();
9293
}
9394
};
@@ -107,10 +108,8 @@ public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) {
107108
// [END pullSubscriber]
108109
}
109110

110-
private Subscriber createSubscriberWithErrorListener() throws Exception {
111+
private Subscriber createSubscriberWithErrorListener(Subscriber subscriber) throws Exception {
111112
// [START subscriberWithErrorListener]
112-
Subscriber subscriber = Subscriber.defaultBuilder(subscriptionName, receiver).build();
113-
114113
subscriber.addListener(new Subscriber.Listener() {
115114
public void failed(Subscriber.State from, Throwable failure) {
116115
// Handle error.

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.google.cloud.spanner;
1818

19-
import com.google.cloud.BaseServiceException;
2019
import com.google.cloud.grpc.BaseGrpcServiceException;
2120
import com.google.common.base.Preconditions;
2221
import javax.annotation.Nullable;

google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ public static HttpTransportOptions getDefaultHttpTransportOptions() {
105105
return HttpTransportOptions.newBuilder().build();
106106
}
107107

108+
// Project ID is only required for creating buckets, so we don't require it for creating the
109+
// service.
110+
@Override
111+
protected boolean projectIdRequired() {
112+
return false;
113+
}
114+
108115
@Override
109116
protected Set<String> getScopes() {
110117
return SCOPES;

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@
129129
<site.installationModule>google-cloud</site.installationModule>
130130

131131
<api-client.version>1.21.0</api-client.version>
132-
<api-common.version>1.0.0</api-common.version>
132+
133+
<api-common.version>1.1.0</api-common.version>
133134
<gax.version>1.1.0</gax.version>
134135
<gax-grpc.version>0.17.0</gax-grpc.version>
135136
<generatedProto.version>0.1.9</generatedProto.version>

0 commit comments

Comments
 (0)