public interface PubSubMessageConverter
Modifier and Type | Method and Description |
---|---|
default com.google.pubsub.v1.PubsubMessage |
byteStringToPubSubMessage(com.google.protobuf.ByteString payload,
Map<String,String> headers) |
<T> T |
fromPubSubMessage(com.google.pubsub.v1.PubsubMessage message,
Class<T> payloadType)
Convert the payload of a given
PubsubMessage to a desired Java type. |
com.google.pubsub.v1.PubsubMessage |
toPubSubMessage(Object payload,
Map<String,String> headers)
Create a
PubsubMessage given an object for the payload and a map of headers. |
com.google.pubsub.v1.PubsubMessage toPubSubMessage(Object payload, Map<String,String> headers)
PubsubMessage
given an object for the payload and a map of headers.payload
- the object to place into the message payloadheaders
- the headers of the message<T> T fromPubSubMessage(com.google.pubsub.v1.PubsubMessage message, Class<T> payloadType)
PubsubMessage
to a desired Java type.T
- the type of the payloadmessage
- the message containing the payload of the objectpayloadType
- the desired type of the objectCopyright © 2021. All rights reserved.