<commit_before>## Kafka Receiver

To change Zipkin's transport mechanism to use kafka.
 * change the contents of the Main.scala file
 * this setup requires cassandra
 * ```bin/collector cassandra```


```scala
# zipkin/zipkin-collector-service/src/main/scala/com/twitter/zipkin/collector/Main.scala

import com.twitter.zipkin.thriftscala.{Span => ThriftSpan}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.server.TwitterServer
import com.twitter.util.{Await, Future}
import com.twitter.zipkin.cassandra.CassandraSpanStoreFactory
import com.twitter.zipkin.collector.{SpanReceiver, ZipkinQueuedCollectorFactory}
import com.twitter.zipkin.common._
import com.twitter.zipkin.receiver.kafka.KafkaSpanReceiverFactory
import com.twitter.zipkin.storage.WriteSpanStore
import kafka.serializer.Decoder

import com.twitter.zipkin.receiver.kafka.SpanDecoder

object ZipkinKafkaCollectorServer extends TwitterServer
  with ZipkinQueuedCollectorFactory
  with CassandraSpanStoreFactory
  with KafkaSpanReceiverFactory
{
  def newReceiver(receive: Seq[ThriftSpan] => Future[Unit], stats: StatsReceiver): SpanReceiver = {
    newKafkaSpanReceiver(receive, stats.scope("kafkaSpanReceiver"), Some(new SpanDecoder()), new SpanDecoder())
  }

  def newSpanStore(stats: StatsReceiver): WriteSpanStore =
    newCassandraStore(stats.scope("cassandra"))<commit_msg>update kafka receiver docs<commit_after>## Kafka Receiver

To change Zipkin's transport mechanism to use kafka.
 * change the contents of the Main.scala file to below code
 * this config requires cassandra and zookeeper
 * remove '-f' from zipkin-receiver-kafka/build.gradle (i.e. args '-f', "${projectDir}...")
 * ```bin/collector cassandra```


```scala
package com.twitter.zipkin.collector

import com.twitter.zipkin.thriftscala.{Span => ThriftSpan}
import com.twitter.finagle.stats.StatsReceiver
import com.twitter.server.TwitterServer
import com.twitter.util.{Await, Future}
import com.twitter.zipkin.cassandra.CassandraSpanStoreFactory
import com.twitter.zipkin.collector.{SpanReceiver, ZipkinQueuedCollectorFactory}
import com.twitter.zipkin.common._
import com.twitter.zipkin.receiver.kafka.KafkaSpanReceiverFactory
import com.twitter.zipkin.storage.cassandra.CassandraSpanStore
import kafka.serializer.Decoder

import com.twitter.zipkin.receiver.kafka.SpanDecoder

import com.twitter.zipkin.receiver.kafka.ZooKeeperClientFactory

// 'Main' object referenced by project's build.gradle
object Main extends TwitterServer
  with ZipkinQueuedCollectorFactory
  with CassandraSpanStoreFactory
  with ZooKeeperClientFactory
  with KafkaSpanReceiverFactory
{
  def newReceiver(receive: Seq[ThriftSpan] => Future[Unit], stats: StatsReceiver): SpanReceiver = {
    newKafkaSpanReceiver(receive, stats.scope("kafkaSpanReceiver"), Some(new SpanDecoder()), new SpanDecoder())
  }

  def newSpanStore(stats: StatsReceiver): CassandraSpanStore =
    newCassandraStore(stats.scope("cassandra"))
{'fraction_non_alphanumeric': 0.09704784526637258, 'fraction_numerical': 0.0, 'mean_word_length': 6.37, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '880470', 'n_tokens_mistral': 910, 'n_tokens_neox': 867, 'n_words': 184}