Class PubSubTopicUtils


  • public final class PubSubTopicUtils
    extends java.lang.Object
    Various utility methods for dealing with Pub/Sub topics. Original source at : https://github.com/spring-cloud/spring-cloud-gcp/blob/master/spring-cloud-gcp-pubsub/src/main/java/org/springframework/cloud/gcp/pubsub/support/PubSubTopicUtils.java
    Since:
    2.0.0
    Author:
    Mike Eltsufin, Vinicius Carvalho
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.google.pubsub.v1.ProjectTopicName toProjectTopicName​(java.lang.String topic, java.lang.String projectId)
      Create a ProjectTopicName based on a topic name within a project or the fully-qualified topic name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toProjectTopicName

        public static com.google.pubsub.v1.ProjectTopicName toProjectTopicName​(@Nonnull
                                                                               java.lang.String topic,
                                                                               @Nonnull
                                                                               java.lang.String projectId)
        Create a ProjectTopicName based on a topic name within a project or the fully-qualified topic name. If the specified topic is in the projects/<project_name>/topics/<topic_name> format, then the projectId is ignored}
        Parameters:
        topic - the topic name in the project or the fully-qualified project name
        projectId - the project ID to use if the topic is not a fully-qualified name
        Returns:
        the Pub/Sub object representing the topic name