Class PubSubTopicUtils
java.lang.Object
com.google.cloud.spring.pubsub.support.PubSubTopicUtils
Various utility methods for dealing with Pub/Sub topics.
- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.pubsub.v1.ProjectTopicName
toProjectTopicName
(String topic, String projectId) Create aProjectTopicName
based on a topic name within a project or the fully-qualified topic name.static com.google.pubsub.v1.TopicName
toTopicName
(String topic, String projectId) Create aTopicName
based on a topic name within a project or the fully-qualified topic name.
-
Method Details
-
toProjectTopicName
public static com.google.pubsub.v1.ProjectTopicName toProjectTopicName(String topic, @Nullable String projectId) Create aProjectTopicName
based on a topic name within a project or the fully-qualified topic name. If the specified topic is in theprojects/[project_name]/topics/[topic_name]
format, then theprojectId
is ignored}- Parameters:
topic
- the topic name in the project or the fully-qualified project nameprojectId
- the project ID to use if the topic is not a fully-qualified name- Returns:
- the Pub/Sub object representing the topic name
-
toTopicName
Create aTopicName
based on a topic name within a project or the fully-qualified topic name. If the specified topic is in theprojects/[project_name]/topics/[topic_name]
format, then theprojectId
is ignored}- Parameters:
topic
- the topic name in the project or the fully-qualified project nameprojectId
- the project ID to use if the topic is not a fully-qualified name- Returns:
- the Pub/Sub object representing the topic name
-