Skip to content

Commit

Permalink
GH-249 Updated Copyright and Javadoc related comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthjain210 committed Jan 2, 2025
1 parent 974d0fc commit 51027aa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2017-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2024 the original author or authors.
* Copyright 2019-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,8 +66,8 @@
/**
* The {@link AbstractMessageHandler} implementation for the Amazon Kinesis Producer Library {@code putRecord(s)}.
* <p>
* {@link KplBackpressureException} is thrown when backpressure handling is enabled and buffer is at max capacity.
* The exception can be handled with
* The {@link KplBackpressureException} is thrown when backpressure handling is enabled and buffer is at max capacity.
* This exception can be handled with
* {@link org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice}.
* </p>
*
Expand Down Expand Up @@ -127,12 +127,12 @@ public void setConverter(Converter<Object, byte[]> converter) {
* Configure maximum records in flight for handling backpressure. By default, backpressure handling is not enabled.
* When backpressure handling is enabled and number of records in flight exceeds the threshold, a
* {@link KplBackpressureException} would be thrown.
* @param backPressureThreshold Defaulted to 0. Set a value greater than 0 to enable backpressure handling.
* @param backPressureThreshold Set a value greater than 0 to enable backpressure handling.
* @since 3.0.9
*/
public void setBackPressureThreshold(long backPressureThreshold) {
Assert.isTrue(backPressureThreshold >= 0,
"'backPressureThreshold must be greater than equal to 0.");
"'backPressureThreshold must be greater than or equal to 0.");
this.backPressureThreshold = backPressureThreshold;
}

Expand Down Expand Up @@ -392,7 +392,7 @@ private CompletableFuture<UserRecordResponse> handleUserRecord(UserRecord userRe
if (this.backPressureThreshold > 0) {
var numberOfRecordsInFlight = this.kinesisProducer.getOutstandingRecordsCount();
if (numberOfRecordsInFlight > this.backPressureThreshold) {
throw new KplBackpressureException("Cannot send record to kinesis since buffer is at max capacity.",
throw new KplBackpressureException("Cannot send record to Kinesis since buffer is at max capacity.",
userRecord);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2024 the original author or authors.
* Copyright 2025-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@

/**
* An exception triggered from {@link org.springframework.integration.aws.outbound.KplMessageHandler} while sending
* records to kinesis when maximum number of records in flight exceeds the backpressure threshold.
* records to Kinesis when maximum number of records in flight exceeds the backpressure threshold.
*
* @author Siddharth Jain
*
Expand All @@ -39,7 +39,7 @@ public KplBackpressureException(String message, UserRecord userRecord) {

/**
* Get the {@link UserRecord} related.
* @return {@link UserRecord} linked while sending the record to kinesis.
* @return {@link UserRecord} linked while sending the record to Kinesis.
*/
public UserRecord getUserRecord() {
return this.userRecord;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2024 the original author or authors.
* Copyright 2019-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -139,7 +139,7 @@ void kplMessageHandlerWithRawPayloadBackpressureEnabledCapacityInsufficient() {
.isThrownBy(() -> this.kinesisSendChannel.send(message))
.withCauseInstanceOf(MessageHandlingException.class)
.withRootCauseExactlyInstanceOf(KplBackpressureException.class)
.withStackTraceContaining("Cannot send record to kinesis since buffer is at max capacity.");
.withStackTraceContaining("Cannot send record to Kinesis since buffer is at max capacity.");

verify(this.kinesisProducer, Mockito.never()).addUserRecord(any(UserRecord.class));
verify(this.kinesisProducer).getOutstandingRecordsCount();
Expand Down

0 comments on commit 51027aa

Please sign in to comment.