Comments (9)
Which version of the consumer you are running ? It is due to version of your Spark (1.6.0) and version in pom doesn't match. You can git clone the code and update the consumer pom to match your version and try. But using spark 1.6 you may see couple of compilation issue which are easy to solve.
Here are the steps you can try.
-
git clone the latest code.
-
modify pom.xml to match your kafka and spark version ( including scala version)
e.g.
**
<spark.version>1.6.0</spark.version>
<kafka.version>0.10.2.0</kafka.version>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>**
and
**<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.10</artifactId>**
and
**<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>**
- As Spark 1.6 and 2.0 has some incompatible changes, you need to remove one Listener call back from
consumer.kafka.ReceiverStreamListener.java
remove this import
import org.apache.spark.streaming.scheduler.StreamingListenerStreamingStarted;
and remove this call back
**@Override
public void onStreamingStarted(StreamingListenerStreamingStarted arg0) {
}**
- Spark 1.6 and 2.0 has another incompatibility for return type of PairFlatMapFunction. So you need to modify this file consumer.kafka.PartitionOffsetPair.java
change return type of call method
public Iterator<Tuple2<Integer, Long>> call(Iterator<MessageAndMetadata> it)
to
public Iterable<Tuple2<Integer, Long>> call(Iterator<MessageAndMetadata> it)
And change the return type from
return kafkaPartitionToOffsetList.iterator();
to
**return kafkaPartitionToOffsetList;**
That's it. Build the consumer and you should be all set to use it for Spark 1.6 and Kafka 0.10.2
Let me know if you face any issues.
Dibyendu
from kafka-spark-consumer.
Or another option is use consumer version 1.0.9. That will work with Spark 1.6
<dependency>
<groupId>dibbhatt</groupId>
<artifactId>kafka-spark-consumer</artifactId>
**<version>1.0.9</version>**
</dependency>
from kafka-spark-consumer.
Here is the V 1.0.9 READ ME
https://github.com/dibbhatt/kafka-spark-consumer/tree/117f98ccf02ad4f6e5a8b8918b5db097e7d3a3d4
from kafka-spark-consumer.
Thank you for your quick response!
I used your first approach and modified the latest code to use my versions of Kafka, Spark and Scala. Seems to work.
I will do some more extensive testing during this week. If I find anything else I'll let you know.
Cheers!
from kafka-spark-consumer.
Perfect. Do let me know if you see any issues or need any help on tuning various knobs .
from kafka-spark-consumer.
When spark job was submitted The system loaded the default jar of CDH(spark-assembly-1.6.0-cdh5.14.4-hadoop2.6.0-cdh5.14.4.jar)γThe Kafka version is not 010γ(0.9.0)
from kafka-spark-consumer.
Hi @LinMingQiang , in your Application pom, what version of jars you have specified ?
from kafka-spark-consumer.
spark 1.6.0 kafka 0.10.0
from kafka-spark-consumer.
Whats the issue you see ? Is the streaming job not running ?
from kafka-spark-consumer.
Related Issues (20)
- Why appear this exception information? HOT 8
- Not working with Spark 2.2.0 HOT 11
- How to use in kerberized context ? HOT 3
- Exception: Could not compute split, block not found HOT 6
- Hello, Compilation failed after changing Kafka version 0.10.0.0 HOT 5
- Kafka Headers Support HOT 7
- After long time running, the processing time of "ProcessedOffsetManager.persists(partitonOffset_stream, props)" incresing. HOT 13
- How to recover the failed receiver on a partition which has exception of " Offsets out of range with no configured reset policy for partitions:" HOT 18
- May I have a Scala sample of messageHandler to filter out some playload which includes some strings? HOT 20
- The Spark Streaming can not read kafka message HOT 8
- It works well in local model,but when I submit it in cluster model,the fixed rate is too small HOT 5
- Does this support spark structured streaming HOT 1
- java.lang.NoClassDefFoundError: kafka/api/OffsetRequest HOT 22
- Offset is still updated when exception occurs during processing HOT 28
- Manipulation of offsetRanges in each batch
- example doesn't build HOT 1
- Trying to fetch Multi topic In Local , But It is showing warning like this HOT 2
- Can a higher version of kafka be supported HOT 2
- Can a higher version of Spark be supported? Spark 3.2.0 for example. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-spark-consumer.