Skip to content

Commit 3223c55

Browse files
committed
Issue-334 fix to handle when the event is not added to queue in case of queue full for concurrenthec
1 parent 0e5d208 commit 3223c55

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Splunk Connect for Kafka test
1+
## Splunk Connect for Kafka
22

33
Splunk Connect for Kafka is a Kafka Connect Sink for Splunk with the following features:
44

src/main/java/com/splunk/hecclient/ConcurrentHec.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public ConcurrentHec(int numberOfThreads, boolean useAck, HecConfig config, Poll
5757
@Override
5858
public final void send(final EventBatch batch) {
5959
try {
60-
batches.offer(batch, 1000, TimeUnit.MILLISECONDS);
60+
boolean offerSuccess = batches.offer(batch, 1000, TimeUnit.MILLISECONDS);
61+
if (!offerSuccess) {
62+
log.warn("Linked blocking queue is full (size = {}) for event batch = {}, failed to offer batch into queue", batches.size(), batch.getUUID());
63+
throw new HecException("linked blocking event queue is full, failed to offer batch into queue");
64+
}
6165
} catch (InterruptedException ex) {
6266
throw new HecException("failed to offer batch into queue", ex);
6367
}

0 commit comments

Comments
 (0)