Skip to content

Commit 5bc9479

Browse files
Merge pull request #230084 from spelluru/patch-166
added a note after the readStream call
2 parents 54d1878 + 2461e61 commit 5bc9479

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

articles/event-hubs/event-hubs-kafka-spark-tutorial.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Connect with your Apache Spark app - Azure Event Hubs | Microsoft Docs
33
description: This article provides information on how to use Apache Spark with Azure Event Hubs for Kafka.
44
ms.topic: how-to
5-
ms.date: 09/28/2021
5+
ms.date: 03/09/2023
66
ms.devlang: scala
77
---
88

@@ -68,6 +68,12 @@ val df_write = df.writeStream
6868
.start()
6969
```
7070

71+
If you receive an error similar to the following error, add `.option("spark.streaming.kafka.allowNonConsecutiveOffsets", "true")` to the `spark.readStream` call and try again.
72+
73+
```bash
74+
IllegalArgumentException: requirement failed: Got wrong record for <spark job name> even after seeking to offset 4216 got offset 4217 instead. If this is a compacted topic, consider enabling spark.streaming.kafka.allowNonConsecutiveOffsets
75+
```
76+
7177
## Write to Event Hubs for Kafka
7278
You can also write to Event Hubs the same way you write to Kafka. Don't forget to update your configuration to change **BOOTSTRAP_SERVERS** and **EH_SASL** with information from your Event Hubs namespace. For the full sample code, see sparkProducer.scala file on the GitHub.
7379

0 commit comments

Comments
 (0)