diff --git a/zio-kafka/src/main/scala/zio/kafka/consumer/Consumer.scala b/zio-kafka/src/main/scala/zio/kafka/consumer/Consumer.scala index fc46b03d0..3ab626cb9 100644 --- a/zio-kafka/src/main/scala/zio/kafka/consumer/Consumer.scala +++ b/zio-kafka/src/main/scala/zio/kafka/consumer/Consumer.scala @@ -3,7 +3,6 @@ package zio.kafka.consumer import org.apache.kafka.clients.consumer.{ Consumer => JConsumer, ConsumerRecord, - KafkaConsumer, OffsetAndMetadata, OffsetAndTimestamp } @@ -192,22 +191,6 @@ object Consumer { * * You are responsible for creating and closing the KafkaConsumer */ - def fromJavaConsumer( - javaConsumer: KafkaConsumer[Array[Byte], Array[Byte]], - settings: ConsumerSettings, - diagnostics: Diagnostics = Diagnostics.NoOp - ): ZIO[Scope, Throwable, Consumer] = - for { - _ <- ZIO.addFinalizer(diagnostics.emit(Finalization.ConsumerFinalized)) - consumerAccess <- ConsumerAccess.make(javaConsumer) - runloopAccess <- RunloopAccess.make(settings, consumerAccess, diagnostics) - } yield new ConsumerLive(consumerAccess, runloopAccess) - - /** - * Create a zio-kafka Consumer from an org.apache.kafka Consumer - * - * You are responsible for creating and closing the Consumer - */ def fromJavaConsumer( javaConsumer: JConsumer[Array[Byte], Array[Byte]], settings: ConsumerSettings, diff --git a/zio-kafka/src/main/scala/zio/kafka/producer/Producer.scala b/zio-kafka/src/main/scala/zio/kafka/producer/Producer.scala index 14196d7fe..c2123040b 100644 --- a/zio-kafka/src/main/scala/zio/kafka/producer/Producer.scala +++ b/zio-kafka/src/main/scala/zio/kafka/producer/Producer.scala @@ -211,25 +211,6 @@ object Producer { * * You are responsible for creating and closing the KafkaProducer */ - def fromJavaProducer( - javaProducer: KafkaProducer[Array[Byte], Array[Byte]], - settings: ProducerSettings - ): ZIO[Scope, Throwable, Producer] = - for { - runtime <- ZIO.runtime[Any] - sendQueue <- - Queue.bounded[(Chunk[ByteRecord], Promise[Nothing, Chunk[Either[Throwable, RecordMetadata]]])]( - settings.sendBufferSize - ) - producer = new ProducerLive(javaProducer, runtime, sendQueue) - _ <- ZIO.blocking(producer.sendFromQueue).forkScoped - } yield producer - - /** - * Create a zio-kafka Producer from an existing org.apache.kafka Producer - * - * You are responsible for creating and closing the Producer - */ def fromJavaProducer( javaProducer: JProducer[Array[Byte], Array[Byte]], settings: ProducerSettings