Packages

object JdbcProjection

Annotations
@ApiMayChange()
Source
JdbcProjection.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JdbcProjection
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def atLeastOnce[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: () => JdbcHandler[Envelope, S])(implicit system: ActorSystem[_]): AtLeastOnceProjection[Offset, Envelope]

    Create a pekko.projection.Projection with at-least-once processing semantics.

    Create a pekko.projection.Projection with at-least-once processing semantics.

    It stores the offset in a relational database table using JDBC after the handler has processed the envelope. This means that if the projection is restarted from previously stored offset then some elements may be processed more than once.

    The JdbcHandler.process() in handler will be wrapped in a transaction. It is highly recommended to use a sessionFactory that provides java.sql.Connection's with setAutoCommit(false). The transaction will be committed after invoking JdbcHandler.process().

    The offset is stored after a time window, or limited by a number of envelopes, whatever happens first. This window can be defined with AtLeastOnceProjection.withSaveOffset of the returned AtLeastOnceProjection. The default settings for the window is defined in configuration section pekko.projection.at-least-once.

  6. def atLeastOnceAsync[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: () => Handler[Envelope])(implicit system: ActorSystem[_]): AtLeastOnceProjection[Offset, Envelope]

    Create a pekko.projection.Projection with at-least-once processing semantics.

    Create a pekko.projection.Projection with at-least-once processing semantics.

    Compared to JdbcProjection.atLeastOnce the Handler is not storing the projected result in the database, but is integrating with something else.

    It stores the offset in a relational database table using JDBC after the handler has processed the envelope. This means that if the projection is restarted from previously stored offset then some elements may be processed more than once.

    The offset is stored after a time window, or limited by a number of envelopes, whatever happens first. This window can be defined with AtLeastOnceProjection.withSaveOffset of the returned AtLeastOnceProjection. The default settings for the window is defined in configuration section pekko.projection.at-least-once.

  7. def atLeastOnceFlow[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: FlowWithContext[Envelope, ProjectionContext, Done, ProjectionContext, _])(implicit system: ActorSystem[_]): AtLeastOnceFlowProjection[Offset, Envelope]

    Create a pekko.projection.Projection with a FlowWithContext as the envelope handler.

    Create a pekko.projection.Projection with a FlowWithContext as the envelope handler. It has at-least-once processing semantics.

    The flow should emit a Done element for each completed envelope. The offset of the envelope is carried in the context of the FlowWithContext and is stored in the database when corresponding Done is emitted. Since the offset is stored after processing the envelope it means that if the projection is restarted from previously stored offset then some envelopes may be processed more than once.

    If the flow filters out envelopes the corresponding offset will not be stored, and such envelope will be processed again if the projection is restarted and no later offset was stored.

    The flow should not duplicate emitted envelopes (mapConcat) with same offset, because then it can result in that the first offset is stored and when the projection is restarted that offset is considered completed even though more of the duplicated enveloped were never processed.

    The flow must not reorder elements, because the offsets may be stored in the wrong order and and when the projection is restarted all envelopes up to the latest stored offset are considered completed even though some of them may not have been processed. This is the reason the flow is restricted to FlowWithContext rather than ordinary Flow.

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def createTablesIfNotExists[S <: JdbcSession](sessionFactory: () => S)(implicit system: ActorSystem[_]): Future[Done]

    For testing purposes the projection offset and management tables can be created programmatically.

    For testing purposes the projection offset and management tables can be created programmatically. For production it's recommended to create the table with DDL statements before the system is started.

  10. def dropTablesIfExists[S <: JdbcSession](sessionFactory: () => S)(implicit system: ActorSystem[_]): Future[Done]

    For testing purposes the projection offset and management tables can be dropped programmatically.

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def exactlyOnce[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: () => JdbcHandler[Envelope, S])(implicit system: ActorSystem[_]): ExactlyOnceProjection[Offset, Envelope]

    Create a pekko.projection.Projection with exactly-once processing semantics.

    Create a pekko.projection.Projection with exactly-once processing semantics.

    It stores the offset in a relational database table using JDBC in the same transaction as the user defined handler.

  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def groupedWithin[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: () => JdbcHandler[Seq[Envelope], S])(implicit system: ActorSystem[_]): GroupedProjection[Offset, Envelope]

    Create a pekko.projection.Projection that groups envelopes and calls the handler with a group of Envelopes.

    Create a pekko.projection.Projection that groups envelopes and calls the handler with a group of Envelopes. The envelopes are grouped within a time window, or limited by a number of envelopes, whatever happens first. This window can be defined with GroupedProjection.withGroup of the returned GroupedProjection. The default settings for the window is defined in configuration section pekko.projection.grouped.

    It stores the offset in a relational database table using JDBC in the same transaction as the user defined handler.

  17. def groupedWithinAsync[Offset, Envelope, S <: JdbcSession](projectionId: ProjectionId, sourceProvider: SourceProvider[Offset, Envelope], sessionFactory: () => S, handler: () => Handler[Seq[Envelope]])(implicit system: ActorSystem[_]): GroupedProjection[Offset, Envelope]

    Create a pekko.projection.Projection that groups envelopes and calls the handler with a group of Envelopes.

    Create a pekko.projection.Projection that groups envelopes and calls the handler with a group of Envelopes. The envelopes are grouped within a time window, or limited by a number of envelopes, whatever happens first. This window can be defined with GroupedProjection.withGroup of the returned GroupedProjection. The default settings for the window is defined in configuration section pekko.projection.grouped.

    Compared to JdbcProjection.groupedWithin the Handler is not storing the projected result in the database, but is integrating with something else.

    It stores the offset in a relational database table using JDBC immediately after the handler has processed the envelopes, but that is still with at-least-once processing semantics. This means that if the projection is restarted from previously stored offset the previous group of envelopes may be processed more than once.

  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def createOffsetTableIfNotExists[S <: JdbcSession](sessionFactory: () => S)(implicit system: ActorSystem[_]): Future[Done]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Renamed to createTablesIfNotExists

  2. def dropOffsetTableIfExists[S <: JdbcSession](sessionFactory: () => S)(implicit system: ActorSystem[_]): Future[Done]
    Annotations
    @deprecated
    Deprecated

    (Since version 1.2.0) Renamed to dropTablesIfExists

Inherited from AnyRef

Inherited from Any

Ungrouped