Skip to content

Commit

Permalink
Remove deprecated API
Browse files Browse the repository at this point in the history
  • Loading branch information
kciesielski committed Oct 12, 2015
1 parent e2d3e47 commit f6e33c7
Showing 1 changed file with 1 addition and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,9 @@ import com.softwaremill.react.kafka.ReactiveKafka.DefaultRequestStrategy
import com.softwaremill.react.kafka.commit.{CommitSink, KafkaSink}
import kafka.consumer._
import kafka.producer._
import kafka.serializer.{Decoder, Encoder}
import org.reactivestreams.{Publisher, Subscriber}

class ReactiveKafka(val host: String = "", val zooKeeperHost: String = "") {

/**
* Constructor without default args
*/
def this() = {
this("", "")
}

@deprecated("Use ProducerProps", "0.7.0")
def publish[T](
topic: String,
groupId: String,
encoder: Encoder[T],
partitionizer: T => Option[Array[Byte]] = (_: T) => None
)(implicit actorSystem: ActorSystem): Subscriber[T] = {
ActorSubscriber[T](producerActor(topic, groupId, encoder, partitionizer))
}

@deprecated("Use ProducerProps", "0.7.0")
def producerActor[T](
topic: String,
groupId: String,
encoder: Encoder[T],
partitionizer: T => Option[Array[Byte]]
)(implicit actorSystem: ActorSystem): ActorRef = {
val props = ProducerProperties(host, topic, groupId, encoder, partitionizer: T => Option[Array[Byte]])
producerActor(props)
}
class ReactiveKafka {

def publish[T](
props: ProducerProperties[T],
Expand Down Expand Up @@ -111,44 +82,6 @@ class ReactiveKafka(val host: String = "", val zooKeeperHost: String = "") {
actorSystem.actorOf(producerActorProps(props))
}

@deprecated("Use ConsumerProps", "0.7.0")
def consume[T](
topic: String,
groupId: String,
decoder: Decoder[T]
)(implicit actorSystem: ActorSystem) = {
ActorPublisher[KafkaMessage[T]](consumerActor(topic, groupId, decoder))
}

@deprecated("Use ConsumerProps", "0.7.0")
def consumeFromEnd[T](
topic: String,
groupId: String,
decoder: Decoder[T]
)(implicit actorSystem: ActorSystem): Publisher[T] = {
ActorPublisher[T](consumeFromEndAsActor(topic, groupId, decoder))
}

@deprecated("Use ConsumerProps", "0.7.0")
def consumerActor[T](
topic: String,
groupId: String,
decoder: Decoder[T]
)(implicit actorSystem: ActorSystem): ActorRef = {
val props = ConsumerProperties(host, zooKeeperHost, topic, groupId, decoder)
consumerActor(props)
}

@deprecated("Use ConsumerProps", "0.7.0")
def consumeFromEndAsActor[T](
topic: String,
groupId: String,
decoder: Decoder[T]
)(implicit actorSystem: ActorSystem): ActorRef = {
val props = ConsumerProperties(host, zooKeeperHost, topic, groupId, decoder).readFromEndOfStream()
consumerActor(props)
}

def consume[T](
props: ConsumerProperties[T]
)(implicit actorSystem: ActorSystem) = {
Expand Down

0 comments on commit f6e33c7

Please sign in to comment.