Coder Social home page Coder Social logo

laserdisc-io / tamer Goto Github PK

View Code? Open in Web Editor NEW
42.0 8.0 15.0 1.22 MB

Standalone alternatives to Kafka Connect Connectors

License: MIT License

Scala 96.10% Shell 3.90%
zio-streams kafka jdbc scala fp functional-programming zio doobie fs2 avro

tamer's People

Contributors

amir avatar barambani avatar gurghet avatar mergify[bot] avatar pshirshov avatar scala-steward avatar sharmargilt avatar sirocchj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tamer's Issues

Lower CPU usage

@barambani noticed with S3 module tamer uses 100% cpu.
I suspect because of

ZStream.fromEffect(sink(q, p, sinkRegistry).forever.fork <* log.info("running sink perpetually")).flatMap { fiber =>

More evidence comes from dumping the fibers in a random moment:

#64 (14m871s871268ms) 
   Status: Running()
Fiber:Id(1613749779114,64) was supposed to continue to:
  a future continuation at zio.ZIO.forever(ZIO.scala:686)

Fiber:Id(1613749779114,64) execution trace:
  at zio.ZIO.forever(ZIO.scala:686)
  at zio.ZIO.unit(ZIO.scala:2014)
  at log.effect.LogWriterConstructor$$anon$1$$anon$2.write(LogWriterConstructor.scala:31)
  at tamer.kafka.Kafka$$anon$1.runLoop(Kafka.scala:66)
  at zio.ZQueue$$anon$4.takeAll(ZQueue.scala:627)
  at zio.ZIO$.effectSuspendTotal(ZIO.scala:2662)
  ...

Do you think this is the problem?
Should we solve it by using take, which suspends, instead of takeAll that continuously returning an empty list?

Warn the user of probable point of failure

queue.offer((Right(TransactionDelimiter(p)), Chunk.empty)) *>

A nice enhancement would be to peek into the kafka producer config, get the transaction timeout and issue a human readable warning in case the transaction is still open, the kafka one is hard to understand and often at the other end of the system (wherever the broker is).
Something like "hey, your transaction timeout is set to 30s and yet we are, consider increasing the timeout."

No way to set read timeout for sttp when using simplified API

While connection timeout in STTP is a global setting, and thus easily configurable, read timeout is per request, this means there is no way to set it using the simplified API (because the query builder is provided).
It would be cool to add it as an additional optional setting.

Backoff when caught up

Tamer is designed to always go as fast as possible. Sometimes it may be desirable to slow down, e.g. once we caught up with the "initial load".. We could use a scheduler controlled in the Setup and returned by it so to slow this down, when needed

Add S3 tags and update github description

I noticed there are no S3 tags and the descriptions says "Standalone alternative to Kafka JDBC Connector"
I propose to update it to "Standalone alternative to Kafka JDBC Connector and S3 Kafka Connector"

Add checks for consistency of topic

After #540 there are no more checks of the state topic in case of crashes. On one hand the cases are greatly reduced by the introduction of transactionality, on the other this does nothing to prevent external factors (wrong number of replicas or simply external producers to the topic).
We could add an invariant check, that not only checks the topic for consistency on start up, but also continuously monitors the number of messages read and stops in case more than one message is in the buffer.

`addAuthentication` uses SttpRequest but zio env is optional

override def addAuthentication(request: SttpRequest, bearerToken: Option[String]): SttpRequest = request.auth.bearer(bearerToken.getOrElse(""))

This can result in code like this for custom auth:

val authentication: Authentication[Any] = new Authentication[Any] {
    override def addAuthentication(request: SttpRequest, supplementalSecret: Option[String]): SttpRequest =
    // ...
}

A suggestion is to make the type parameter -R <: SttpClient or to make authentication independent from any particular client.

Field never used in core

The field below, while logically belongs to core, it's never used by it and only used by the modules. This is just code smell and not a real problem but might indicate there is a better way to structure the code.

val recordKey: (S, V) => K

It means it's possible to do things like override Setup and

override val recordKey: (State, LastAlertTime) => LastAlertTimeKey = ???

and make the code still work because you are using a different way to create your record key.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.