Giter Site home page Giter Site logo

Comments (6)

dibbhatt avatar dibbhatt commented on June 18, 2024

Hi,

Did you figure it out how to get the byte messages from Kafka ?

The ReceiverLauncher.launch returns the DStream or JavaDStream (for Java) , and you can call the getPayload on MessageAndMetadata object to get the byte array...

Something like this ..

val tmp_stream = ReceiverLauncher.launch(ssc, props, numberOfReceivers,StorageLevel.MEMORY_ONLY)

//Lets convert the Array[Byte] to String
val stream = tmp_stream.map(x => { val s = new String(x.getPayload); s })

from kafka-spark-consumer.

fzschornack avatar fzschornack commented on June 18, 2024

Hi,

Yes, I figured out few hours ago. I tried to delete the issue but I
couldn't, sorry to bother you.

I did exactly as you said and used the payload. It is working fine.

Thank you so much for creating this receiver, it helped me a lot!

Best,
On Aug 27, 2015 01:28, "Dibyendu Bhattacharya" [email protected]
wrote:

Hi,

Did you figure it out how to get the byte messages from Kafka ?

The ReceiverLauncher.launch returns the DStream or JavaDStream (for Java)
, and you can call the getPayload on MessageAndMetadata object to get the
byte array...

Something like this ..

val tmp_stream = ReceiverLauncher.launch(ssc, props,
numberOfReceivers,StorageLevel.MEMORY_ONLY)

//Lets convert the Array[Byte] to String
val stream = tmp_stream.map(x => { val s = new String(x.getPayload); s })


Reply to this email directly or view it on GitHub
#24 (comment)
.

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on June 18, 2024

Hi,

Not an issue. You can raise any issue/question . Its perfectly fine.

Glad to know this receiver is useful to you ..

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on June 18, 2024

hi @fzschornack

I have created a JIRA to track the progress of contributing back this project to Apache Spark.

https://issues.apache.org/jira/browse/SPARK-11045

This project is now presently in spark-packages and I believe this is the correct time to contribute it to Apache Spark Project and give better options to larger community around Kafka Connectivity for Spark Streaming.

kindly Vote for this JIRA.

from kafka-spark-consumer.

jedisct1 avatar jedisct1 commented on June 18, 2024

Voted!

from kafka-spark-consumer.

dibbhatt avatar dibbhatt commented on June 18, 2024

thanks

from kafka-spark-consumer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.