@Bean
    @ConditionalOnMissingBean(name = "googleCloudPubSubTopics")
    public Map<String, GoogleCloudPubSubMessageContext> googleCloudPubSubTopics(
        @Qualifier("pubSubMessageConverter")
        final PubSubMessageConverter pubSubMessageConverter,
        @Qualifier("messageQueueTicketRegistryReceiver")
        final QueueableTicketRegistryMessageReceiver messageQueueTicketRegistryReceiver,
        final PubSubTemplate pubSubTemplate,
        final PubSubAdmin pubSubAdmin) {

        val googleCloudTopics = new LinkedHashMap<String, GoogleCloudPubSubMessageContext>();

        LOGGER.info("Preparing Google Cloud Pub/Sub topics and subscriptions...");
        val allTopics = pubSubAdmin.listTopics();
        val subscriptions = pubSubAdmin.listSubscriptions();

        val topicName = GoogleCloudTicketRegistryQueuePublisher.QUEUE_TOPIC;
        val subscriptionName = topicName.concat("Subscription");

        val deadLetterTopic = findTopicByName(allTopics, GoogleCloudTicketRegistryQueuePublisher.DEAD_LETTER_TOPIC)
            .orElseGet(() -> pubSubAdmin.createTopic(GoogleCloudTicketRegistryQueuePublisher.DEAD_LETTER_TOPIC));
        val topic = findTopicByName(allTopics, topicName)
            .orElseGet(() -> Objects.requireNonNull(pubSubAdmin.createTopic(topicName)));
        val subscription = getOrCreateSubscription(pubSubAdmin, subscriptions, subscriptionName, topic, deadLetterTopic);
        LOGGER.debug("Created subscription [{}] for topic [{}]", subscription.getName(), topic.getName());
        val subscriber = subscribeToTopic(messageQueueTicketRegistryReceiver, pubSubTemplate, topic, subscription, pubSubMessageConverter);
        val context = new GoogleCloudPubSubMessageContext(topic, subscription, subscriber);
        googleCloudTopics.put(context.topic().getName(), context);
        return googleCloudTopics;
    }
This is {@link CasGoogleCloudPubSubTicketRegistryAutoConfiguration}.

@author Misagh Moayyed
@since 7.0.0
support/cas-server-support-gcp-pubsub-ticket-registry/src/main/java/org/apereo/cas/config/CasGoogleCloudPubSubTicketRegistryAutoConfiguration.java