-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove message grouping for Ably Batch calls
The kafka connector put every message sent to a single channel in one `BatchSpec`, meaning we treated them atomically and send them as a single `ProtocolMessage`. This causes a problem when the total `ProtocolMessage` size gets way too big. That's why now we put every message in its own `BatchSpec`
- Loading branch information
Showing
6 changed files
with
153 additions
and
232 deletions.
There are no files selected for viewing
87 changes: 0 additions & 87 deletions
87
src/main/java/com/ably/kafka/connect/batch/MessageGroup.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/ably/kafka/connect/batch/RecordMessagePair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.ably.kafka.connect.batch; | ||
|
||
import com.ably.kafka.connect.client.BatchSpec; | ||
import io.ably.lib.types.Message; | ||
import org.apache.kafka.connect.sink.SinkRecord; | ||
|
||
/** | ||
* Kafka Records with outgoing Ably Batch Spec. | ||
*/ | ||
public class RecordMessagePair { | ||
private final SinkRecord kafkaRecord; | ||
private final BatchSpec batchSpec; | ||
/** | ||
* Construct a new record-message pairing. | ||
*/ | ||
RecordMessagePair(SinkRecord kafkaRecord, BatchSpec batchSpec) { | ||
this.kafkaRecord = kafkaRecord; | ||
this.batchSpec = batchSpec; | ||
} | ||
|
||
/** | ||
* Returns the incoming Kafka SinkRecord | ||
*/ | ||
public SinkRecord getKafkaRecord() { | ||
return kafkaRecord; | ||
} | ||
|
||
/** | ||
* Returns the outgoing Ably Message | ||
*/ | ||
public BatchSpec getBatchSpec() { | ||
return batchSpec; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.