You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Amrit Jangid <am...@goibibo.com> on 2016/12/22 08:09:40 UTC
Error in kafka-stream example
Hi All,
I want to try out kafka stream example using this example :
https://github.com/confluentinc/examples/blob/3.1.x/kafka-streams/src/main/scala/io/confluent/examples/streams/MapFunctionScalaExample.scala
Getting exception while compiling code :
*[error] val uppercasedWithMapValues: KStream[Array[Byte], String] =
textLines.mapValues(x => makeCaps(x))*
*[error]
^*
*[error] /home/ubuntu/stream/MapFunctionScalaExample.scala:32: missing
parameter type*
*[error] val uppercasedWithMap: KStream[Array[Byte], String] =
textLines.map((key, value) => (key, value.toUpperCase()))*
*[error]
^*
Is this example working for anyone, Has anyone tried it out?
This is my sbt file :
name := "Kafka_Stream_Test"
organization := "com.goibibo"
version := "0.1"
scalaVersion := "2.11.0"
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
resolvers ++= Seq(
"confluent-repository" at "http://packages.confluent.io/maven/"
)
libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-streams" % "0.10.1.0-cp2",
"org.apache.kafka" % "kafka-clients" % "0.10.1.0-cp2"
)
Is there anything i'm missing here ?
Regards,
Amrit
Re: Error in kafka-stream example
Posted by Damian Guy <da...@gmail.com>.
Hi,
Have you tried building the examples with the provided pom.xml? Last i
checked it all compiled and worked.
Thanks
On Thu, 22 Dec 2016 at 16:13 Amrit Jangid <am...@goibibo.com> wrote:
> Hi All,
>
> I want to try out kafka stream example using this example :
>
> https://github.com/confluentinc/examples/blob/3.1.x/kafka-streams/src/main/scala/io/confluent/examples/streams/MapFunctionScalaExample.scala
>
> Getting exception while compiling code :
>
> *[error] val uppercasedWithMapValues: KStream[Array[Byte], String] =
> textLines.mapValues(x => makeCaps(x))*
> *[error]
> ^*
> *[error] /home/ubuntu/stream/MapFunctionScalaExample.scala:32: missing
> parameter type*
> *[error] val uppercasedWithMap: KStream[Array[Byte], String] =
> textLines.map((key, value) => (key, value.toUpperCase()))*
> *[error]
> ^*
>
>
> Is this example working for anyone, Has anyone tried it out?
>
> This is my sbt file :
>
> name := "Kafka_Stream_Test"
> organization := "com.goibibo"
> version := "0.1"
> scalaVersion := "2.11.0"
>
> javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
>
>
> resolvers ++= Seq(
> "confluent-repository" at "http://packages.confluent.io/maven/"
> )
>
> libraryDependencies ++= Seq(
> "org.apache.kafka" % "kafka-streams" % "0.10.1.0-cp2",
> "org.apache.kafka" % "kafka-clients" % "0.10.1.0-cp2"
> )
>
> Is there anything i'm missing here ?
>
>
> Regards,
> Amrit
>