Hi Joe,
I just tried, it works! Now I should to think how to design the partition
function.
Thanks!
Haoming
> Date: Thu, 20 Nov 2014 20:44:29 -0500
> Subject: Re: Partition Key Cannot be Send Out by Producer
> From: joe.st...@stealth.ly
> To: users@kafka.apache.org
>
> Ye
est.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:2722)
> at
> org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1043)
> at org.scalatest.tools.Runner$.main(Runner.scala:860)
> at org.scalatest.tools.Runner.main(Runner.scala)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Nati
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
scala.tools.eclipse.scalatest.launching.ScalaTestLauncher$.main(ScalaTestLauncher.scala:58)
at
scala.tools.eclipse.scalatest.launching.ScalaTestLauncher.main(Sc
val t2 = new NetworkElement("ANY_USER_2", "ANY_TEXT_2",
> BeginningOfEpoch.toSeconds)
> val t3 = new NetworkElement("ANY_USER_3", "ANY_TEXT_3",
> AnyTimestamp.toSeconds)
>
> val messages = Seq(t1, t2, t3)
> }
> }
>
> BTW, I d
> > like the following:
> > val hardKey = "2"
> > val parkey = hardKey.getBytes("UTF8")
> >
> > But I still get the same exception. I also tried set "UTF8" as "UTF-8",
> > but no luck...
> >
>
t;,
> but no luck...
>
> Regards,
> Haoming
>
> > From: ka...@harsha.io
> > To: users@kafka.apache.org
> > Subject: Re: Partition Key Cannot be Send Out by Producer
> > Date: Thu, 20 Nov 2014 16:43:11 -0800
> >
> > Hi Haoming,
> >
quot; as "UTF-8", but no
luck...
Regards,
Haoming
> From: ka...@harsha.io
> To: users@kafka.apache.org
> Subject: Re: Partition Key Cannot be Send Out by Producer
> Date: Thu, 20 Nov 2014 16:43:11 -0800
>
> Hi Haoming,
> Take a look at the code here
>
Hi Haoming,
Take a look at the code here
https://github.com/stealthly/scala-kafka/blob/master/src/main/scala/KafkaProducer.scala
for your partKey it should be string and when you converting it into
byte array you can use partKey.getBytes("UTF8")
-Harsha
On Thu, Nov 20, 2014, a
Hi all,
I'm a beginner of Kafka, currently I'm stuck by how to send out a KeyedMessage
by producer. I would like to design a partition
function to route the message based on the key, but the producer cannot send
the KeyedMessage and I got this exception:
java.lang.ClassCastException: [B cannot b