com.permutive.pubsub.consumer.http

Type members

Classlikes

case class PubsubHttpConsumerConfig[F[_]](host: String, port: Int, isEmulator: Boolean, onTokenRefreshSuccess: Option[F[Unit]], oauthTokenRefreshInterval: FiniteDuration, onTokenRefreshError: PartialFunction[Throwable, F[Unit]], oauthTokenFailureRetryDelay: FiniteDuration, oauthTokenFailureRetryNextDelay: FiniteDuration => FiniteDuration, oauthTokenFailureRetryMaxAttempts: Int, onTokenRetriesExhausted: PartialFunction[Throwable, F[Unit]], acknowledgeBatchSize: Int, acknowledgeBatchLatency: FiniteDuration, readReturnImmediately: Boolean, readMaxMessages: Int, readConcurrency: Int)

Configuration for the PubSub HTTP consumer.

Configuration for the PubSub HTTP consumer.

Note: It is up to the user to raise exceptions and terminate the lifecyle of services if this is desired when retries are exhausted. Token refreshing runs on a background fiber so raising exceptions in onTokenRetriesExhausted will have no effect to the main fibers, in fact errors are swallowed entirely.

Value parameters:
acknowledgeBatchLatency

maximum time to wait before sending an acknowledge batch

acknowledgeBatchSize

maximum number of acknowledge messages to send in a single batch

host

host of PubSub

isEmulator

whether the target PubSub is an emulator or not

oauthTokenFailureRetryDelay

initial delay for retrying OAuth token retrieval

oauthTokenFailureRetryMaxAttempts

how many times to attempt; will raise the last error once reached

oauthTokenFailureRetryNextDelay

next delay for retrying OAuth token retrieval

oauthTokenRefreshInterval

how often to refresh the Google OAuth token

onTokenRefreshError

callback to execute if refreshing the token fails during retries, errors rethrown and retried

onTokenRefreshSuccess

optional callback to execute when refreshing the token succeeds, errors are ignored

onTokenRetriesExhausted

callback to execute if refreshing the token exhausts retries. See note above on exceptions, up to the user to raise exceptions in their service using this callback if required.

port

port of PubSub

readConcurrency

how much parallelism to use when fetching messages from PubSub

readMaxMessages

how many messages to retrieve at once simultaneously

readReturnImmediately

when polling for messages whether to return immediately if there are none or wait (can cause higher CPU use if true)

Source:
PubsubHttpConsumerConfig.scala
case class PubsubMessage(data: String, attributes: Map[String, String], messageId: String, publishTime: String)
Companion:
object
Source:
PubsubMessage.scala