Class SqsIO.WriteBatches<T>

java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<T>,SqsIO.WriteBatches.Result>
org.apache.beam.sdk.io.aws2.sqs.SqsIO.WriteBatches<T>
All Implemented Interfaces:
Serializable, HasDisplayData
Enclosing class:
SqsIO

public abstract static class SqsIO.WriteBatches<T> extends PTransform<PCollection<T>,SqsIO.WriteBatches.Result>
A PTransform to send messages to SQS. See SqsIO for more information on usage and configuration.
See Also:
  • Constructor Details

    • WriteBatches

      public WriteBatches()
  • Method Details

    • withClientConfiguration

      public SqsIO.WriteBatches<T> withClientConfiguration(ClientConfiguration config)
      Configuration of SQS client.
    • withConcurrentRequests

      public SqsIO.WriteBatches<T> withConcurrentRequests(int concurrentRequests)
      Max number of concurrent batch write requests per bundle, default is 5.
    • withEntryMapper

      public SqsIO.WriteBatches<T> withEntryMapper(SqsIO.WriteBatches.EntryMapperFn<T> mapper)
      Optional mapper to create a batch entry from a unique entry id and the input T, otherwise inferred from the schema.
    • withEntryMapper

      Optional mapper to create a batch entry from the input T using a builder, otherwise inferred from the schema.
    • withBatchSize

      public SqsIO.WriteBatches<T> withBatchSize(int batchSize)
      The batch size to use, default (and AWS limit) is 10.
    • withBatchTimeout

      public SqsIO.WriteBatches<T> withBatchTimeout(Duration timeout)
      The duration to accumulate records before timing out, default is 3 secs.

      By default timeouts will be checked upon arrival of records.

    • withBatchTimeout

      public SqsIO.WriteBatches<T> withBatchTimeout(Duration timeout, boolean strict)
      The duration to accumulate records before timing out, default is 3 secs.

      By default timeouts will be checked upon arrival of records. If using strict enforcement, timeouts will be check by a separate thread.

    • to

      Dynamic record based destination to write to.
    • to

      public SqsIO.WriteBatches<T> to(String queueUrl)
      Queue url to write to.
    • expand

      public SqsIO.WriteBatches.Result expand(PCollection<T> input)
      Description copied from class: PTransform
      Override this method to specify how this PTransform should be expanded on the given InputT.

      NOTE: This method should not be called directly. Instead apply the PTransform should be applied to the InputT using the apply method.

      Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).

      Specified by:
      expand in class PTransform<PCollection<T>,SqsIO.WriteBatches.Result>