All Downloads are FREE. Search and download functionalities are using the official Maven repository.

akka.stream.alpakka.kinesis.KinesisErrors.scala Maven / Gradle / Ivy

Go to download

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.

There is a newer version: 6.0.2
Show newest version
/*
 * Copyright (C) 2016-2018 Lightbend Inc. 
 */

package akka.stream.alpakka.kinesis

import com.amazonaws.services.kinesis.model.PutRecordsResultEntry

import scala.util.control.NoStackTrace

object KinesisErrors {

  sealed trait KinesisSourceError extends NoStackTrace
  case object NoShardsError extends KinesisSourceError
  case object GetShardIteratorError extends KinesisSourceError
  case object GetRecordsError extends KinesisSourceError

  sealed trait KinesisFlowErrors extends NoStackTrace
  case class FailurePublishingRecords(e: Exception) extends RuntimeException(e) with KinesisFlowErrors
  case class ErrorPublishingRecords[T](attempts: Int, recordsWithContext: Seq[(PutRecordsResultEntry, T)])
      extends RuntimeException(s"Unable to publish records after $attempts attempts")
      with KinesisFlowErrors {
    val records = recordsWithContext.map(_._1)
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy