GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — updating to v0.11.2-alpha (#596) · Padou/java-docs-samples@4d45b28

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • pubsub/cloud-client
    • pom.xml
    • src
      • main/java/com/example/pubsub
        • QuickstartSample.java
      • test/java/com/example/pubsub
        • QuickstartSampleIT.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎pubsub/cloud-client/pom.xml‎

Copy file name to clipboardExpand all lines: pubsub/cloud-client/pom.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<maven.compiler.target>1.8</maven.compiler.target>
3232
<maven.compiler.source>1.8</maven.compiler.source>
3333
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34-
<pubsub.version>0.9.4-alpha</pubsub.version>
34+
<pubsub.version>0.11.2-alpha</pubsub.version>
3535
</properties>
3636

3737
<dependencies>
Collapse file

‎pubsub/cloud-client/src/main/java/com/example/pubsub/QuickstartSample.java‎

Copy file name to clipboardExpand all lines: pubsub/cloud-client/src/main/java/com/example/pubsub/QuickstartSample.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Imports the Google Cloud client library
2121

2222
import com.google.cloud.ServiceOptions;
23-
import com.google.cloud.pubsub.spi.v1.PublisherClient;
23+
import com.google.cloud.pubsub.spi.v1.TopicAdminClient;
2424
import com.google.pubsub.v1.TopicName;
2525

2626
public class QuickstartSample {
@@ -35,8 +35,8 @@ public static void main(String... args) throws Exception {
3535

3636
// Create a new topic
3737
TopicName topic = TopicName.create(projectId, topicId);
38-
try (PublisherClient publisherClient = PublisherClient.create()) {
39-
publisherClient.createTopic(topic);
38+
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
39+
topicAdminClient.createTopic(topic);
4040
}
4141

4242
System.out.printf("Topic %s:%s created.\n", topic.getProject(), topic.getTopic());
Collapse file

‎pubsub/cloud-client/src/test/java/com/example/pubsub/QuickstartSampleIT.java‎

Copy file name to clipboardExpand all lines: pubsub/cloud-client/src/test/java/com/example/pubsub/QuickstartSampleIT.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import static com.google.common.truth.Truth.assertThat;
2020

2121
import com.google.cloud.ServiceOptions;
22-
import com.google.cloud.pubsub.spi.v1.PublisherClient;
22+
import com.google.cloud.pubsub.spi.v1.TopicAdminClient;
2323
import com.google.pubsub.v1.TopicName;
2424

2525
import org.junit.After;
@@ -43,8 +43,8 @@ public class QuickstartSampleIT {
4343
private PrintStream out;
4444

4545
private void deleteTestTopic() throws Exception {
46-
try (PublisherClient publisherClient = PublisherClient.create()) {
47-
publisherClient.deleteTopic(
46+
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
47+
topicAdminClient.deleteTopic(
4848
TopicName.create(ServiceOptions.getDefaultProjectId(), "my-new-topic"));
4949
} catch (IOException e) {
5050
System.err.println("Error deleting topic " + e.getMessage());

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.