Class PubSubTopicUtils

java.lang.Object
io.micronaut.gcp.pubsub.support.PubSubTopicUtils

public final class PubSubTopicUtils extends 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 Details

    • toProjectTopicName

      public static com.google.pubsub.v1.ProjectTopicName toProjectTopicName(@NonNull @NonNull String topic, @NonNull @NonNull 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