Skip to content

Commit

Permalink
Initialize Java Producer in blocking threadpool (#1230)
Browse files Browse the repository at this point in the history
As far as I understand, the initialization of the Java producer is
side-effecting and blocking. It seems that while the Consumer
initialization is wrapped in ZIO.blocking, the initialization of the
Producer is not
  • Loading branch information
kyri-petrou authored Apr 24, 2024
1 parent f7e6d25 commit f3757dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zio-kafka/src/main/scala/zio/kafka/producer/Producer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ object Producer {
for {
_ <- SslHelper.validateEndpoint(settings.driverSettings)
rawProducer <- ZIO.acquireRelease(
ZIO.attempt(
ZIO.attemptBlocking(
new KafkaProducer[Array[Byte], Array[Byte]](
settings.driverSettings.asJava,
new ByteArraySerializer(),
Expand Down

0 comments on commit f3757dd

Please sign in to comment.