SubscriberConfig

com.sksamuel.elastic4s.streams.SubscriberConfig
case class SubscriberConfig[T](batchSize: Int, concurrentRequests: Int, refreshAfterOp: Boolean, listener: ResponseListener[T], completionFn: () => Unit, successFn: () => Unit, errorFn: Throwable => Unit, failureWait: FiniteDuration, retryFailure: (BulkResponseItem, T) => Boolean, maxAttempts: Int, flushInterval: Option[FiniteDuration], flushAfter: Option[FiniteDuration])

Value parameters

batchSize

the number of elements to group together per batch aside from the last batch

completionFn

a function which is invoked when all sent requests have been acknowledged and the publisher has completed Note: this function is executed regardless of whether there was an error or not, that is, this function is always invoked regardless of the state

concurrentRequests

the number of concurrent batch operations

errorFn

a function which is invoked after there is an error

failureWait

the timeout before re-trying failed requests. Usually a failed request is elasticsearch's way of indicating backpressure, so this parameter determines how long to wait between requests.

flushAfter

used to schedule an index if no document has been received within the given duration. Once an index is performed (either by this flush value or because docs arrived in time) the flush after schedule is reset.

flushInterval

used to schedule periodic bulk indexing. This can be set to avoid waiting for a complete batch for a long period of time. It also is used if the publisher will never complete. This ensures that all elements are indexed, even if the last batch size is lower than batch size.

listener

a listener which is notified on each acknowledge batch item

maxAttempts

the max number of times to try a request. If it fails too many times it probably isn't back pressure but an error with the document.

refreshAfterOp

if the index should be refreshed after each bulk operation

retryFailure

a function which is invoked for every failure in a bulk request, and returns true if the failure should be retried or false if it should not.

successFn

a function will is only invoked when all operations have completed successfully

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product