File tree 3 files changed +7
-7
lines changed
main/java/com/example/pubsub
test/java/com/example/pubsub
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 31
31
<maven .compiler.target>1.8</maven .compiler.target>
32
32
<maven .compiler.source>1.8</maven .compiler.source>
33
33
<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>
35
35
</properties >
36
36
37
37
<dependencies >
Original file line number Diff line number Diff line change 20
20
// Imports the Google Cloud client library
21
21
22
22
import com .google .cloud .ServiceOptions ;
23
- import com .google .cloud .pubsub .spi .v1 .PublisherClient ;
23
+ import com .google .cloud .pubsub .spi .v1 .TopicAdminClient ;
24
24
import com .google .pubsub .v1 .TopicName ;
25
25
26
26
public class QuickstartSample {
@@ -35,8 +35,8 @@ public static void main(String... args) throws Exception {
35
35
36
36
// Create a new topic
37
37
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 );
40
40
}
41
41
42
42
System .out .printf ("Topic %s:%s created.\n " , topic .getProject (), topic .getTopic ());
Original file line number Diff line number Diff line change 19
19
import static com .google .common .truth .Truth .assertThat ;
20
20
21
21
import com .google .cloud .ServiceOptions ;
22
- import com .google .cloud .pubsub .spi .v1 .PublisherClient ;
22
+ import com .google .cloud .pubsub .spi .v1 .TopicAdminClient ;
23
23
import com .google .pubsub .v1 .TopicName ;
24
24
25
25
import org .junit .After ;
@@ -43,8 +43,8 @@ public class QuickstartSampleIT {
43
43
private PrintStream out ;
44
44
45
45
private void deleteTestTopic () throws Exception {
46
- try (PublisherClient publisherClient = PublisherClient .create ()) {
47
- publisherClient .deleteTopic (
46
+ try (TopicAdminClient topicAdminClient = TopicAdminClient .create ()) {
47
+ topicAdminClient .deleteTopic (
48
48
TopicName .create (ServiceOptions .getDefaultProjectId (), "my-new-topic" ));
49
49
} catch (IOException e ) {
50
50
System .err .println ("Error deleting topic " + e .getMessage ());
You can’t perform that action at this time.
0 commit comments