@Override
    public PubsubMessage toPubSubMessage(final Object payload, final Map<String, String> headers) {
        return FunctionUtils.doUnchecked(() -> {
            val serialized = MAPPER.writeValueAsString(payload).getBytes(StandardCharsets.UTF_8);
            val convertedPayload = cipherExecutor.encode(serialized);
            return super.toPubSubMessage(convertedPayload, headers);
        });
    }
This is {@link GoogleCloudPubSubMessageConverter}.

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