Help with this package downloading error

my build.sbt:

scalaVersion := "2.12.15"

resolvers += Resolver.bintrayRepo("cakesolutions", "maven")

libraryDependencies += "net.cakesolutions" %% "scala-kafka-client" % "2.3.1"

When I run sbt package I got the error:

[error] sbt.librarymanagement.ResolveException: Error downloading net.cakesolutions:scala-kafka-client_2.12:2.3.1
[error]   Not found
[error]   Not found
[error]   not found: /home/xxx/.ivy2/localnet.cakesolutions/scala-kafka-client_2.12/2.3.1/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/net/cakesolutions/scala-kafka-client_2.12/2.3.1/scala-kafka-client_2.12-2.3.1.pom
[error]   download error: Caught java.io.IOException (Server returned HTTP response code: 502 for URL: https://dl.bintray.com/cakesolutions/maven/net/cakesolutions/scala-kafka-client_2.12/2.3.1/scala-kafka-client_2.12-2.3.1.pom) while downloading https://dl.bintray.com/cakesolutions/maven/net/cakesolutions/scala-kafka-client_2.12/2.3.1/scala-kafka-client_2.12-2.3.1.pom
[error] 	at lmcoursier.CoursierDependencyResolution.unresolvedWarningOrThrow(CoursierDependencyResolution.scala:345)
[error] 	at lmcoursier.CoursierDependencyResolution.$anonfun$update$38(CoursierDependencyResolution.scala:314)

The package url is got from this MavenRepo.

Can you help look at this? Thank you.

It seems that library is not longer maintained and bintray closed the last year and it seems they didn’t migrated their artifacts to other repository.

I would suggest looking for other client.

1 Like

You could try browsing Scaladex. I have recently tinkered with kafka4s and fs2-kafka. Both looked pretty decent, I stuck with fs2-kafka and I’m happy so far. However, both require some familiarity with libraries like cats-effect and fs2. If this is not given, the learning curve probably is pretty steep (though certainly worthwhile eventually). Perhaps somebody can suggest another library with less conceptual baggage…

2 Likes

Is kafka developed by scala?
Why the official has no native kafka client?

The core of Kafka is implemented in the Scala language. Kafka is made by Confluent, a company with no special connection to the Scala organization.

Confluent lists Scala among their supported languages at https://github.com/confluentinc/examples/blob/5.5.0-post/clients/cloud/README.md

If you click through to the Scala example, you’ll see that https://github.com/confluentinc/examples/blob/5.5.0-post/clients/cloud/scala/build.sbt has dependencies including:

  "org.apache.kafka" % "kafka-streams" % "2.4.0",
  "org.apache.kafka" %% "kafka-streams-scala" % "2.4.0",

So it appears that kafka-streams-scala is the official Scala client. (Just as a historical footnote, it was originally developed at Lightbend (reference).)

Of course, the existence of an official client doesn’t prevent others from providing additional wrappers and alternatives.

1 Like