@@ -6,6 +6,7 @@ use futures::FutureExt;
6
6
use snafu:: Snafu ;
7
7
use vector_config:: { component:: GenerateConfig , configurable_component} ;
8
8
9
+ use crate :: sinks:: util:: retries:: RetryAction ;
9
10
use crate :: {
10
11
aws:: { create_client, is_retriable_error, ClientBuilder } ,
11
12
config:: { AcknowledgementsConfig , Input , ProxyConfig , SinkConfig , SinkContext } ,
@@ -148,6 +149,9 @@ impl SinkConfig for KinesisStreamsSinkConfig {
148
149
self . partition_key_field . clone ( ) ,
149
150
batch_settings,
150
151
KinesisStreamClient { client } ,
152
+ KinesisRetryLogic {
153
+ retry_partial : self . base . request_retry_partial ,
154
+ } ,
151
155
) ?;
152
156
153
157
Ok ( ( sink, healthcheck) )
@@ -173,7 +177,9 @@ impl GenerateConfig for KinesisStreamsSinkConfig {
173
177
}
174
178
}
175
179
#[ derive( Default , Clone ) ]
176
- struct KinesisRetryLogic ;
180
+ struct KinesisRetryLogic {
181
+ retry_partial : bool ,
182
+ }
177
183
178
184
impl RetryLogic for KinesisRetryLogic {
179
185
type Error = SdkError < KinesisError > ;
@@ -193,6 +199,15 @@ impl RetryLogic for KinesisRetryLogic {
193
199
}
194
200
is_retriable_error ( error)
195
201
}
202
+
203
+ fn should_retry_response ( & self , response : & Self :: Response ) -> RetryAction {
204
+ if response. failure_count > 0 && self . retry_partial {
205
+ let msg = format ! ( "partial error count {}" , response. failure_count) ;
206
+ RetryAction :: Retry ( msg. into ( ) )
207
+ } else {
208
+ RetryAction :: Successful
209
+ }
210
+ }
196
211
}
197
212
198
213
#[ cfg( test) ]
0 commit comments