Commit ea144811 authored by Bergamote Orange's avatar Bergamote Orange
Browse files

Merge branch 'bugfix/fix-rate-limiting-maxbound'

parents 492b6821 629f0217
Pipeline #574943 passed with stages
in 20 minutes and 50 seconds
......@@ -65,18 +65,23 @@ public class ApnsClientConfiguration {
}
}
private ApnsOperations buildRateLimitingTemplate(final ApnsOperations apnsOperations) {
return new RateLimitingApnsTemplate(
robertPushServerProperties.getMaxNotificationsPerSecond(),
robertPushServerProperties.getMaxNumberOfPendingNotifications(),
apnsOperations
);
}
@Bean
public ApnsOperations apnsTemplate() {
final var mesuredApnsTemplates = robertPushServerProperties.getApns().getClients().stream()
final var measuredRateLimitedApnsTemplates = robertPushServerProperties.getApns().getClients().stream()
.map(this::buildMeasureApnsTemplate)
.map(this::buildRateLimitingTemplate)
.collect(toUnmodifiableList());
return new RateLimitingApnsTemplate(
robertPushServerProperties.getMaxNotificationsPerSecond(),
robertPushServerProperties.getMaxNumberOfPendingNotifications(),
new FailoverApnsTemplate(
mesuredApnsTemplates, robertPushServerProperties.getApns().getInactiveRejectionReason()
)
return new FailoverApnsTemplate(
measuredRateLimitedApnsTemplates, robertPushServerProperties.getApns().getInactiveRejectionReason()
);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment