You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* retry pattern for specific topic and docs
* removed commented cod
* review comments and updated docs
* removed else part code improve
* Update guide-kafka.asciidoc
* retry pattern for specific topic and docs
* removed commented cod
* review comments and updated docs
* removed else part code improve
* Update guide-kafka.asciidoc
* modified value to key for loggers
Co-authored-by: Simon Spielmann <[email protected]>
=== Retry configuration and naming convention of redelivery topics.
226
226
The following properties should be added in the `application.properties` or `application.yml` file.
227
227
228
+
The retry pattern in devon4j-kafka will perform for specific topic of a message. So its mandatory to specify the properties for each topic. Below properties are example,
If you notice the above properties, the `retry-policy` and `back-off policy` properties are repeated twice as i have 2 topics for the retry to be performed with different level of values. The topic name should be added at the last of attribute.
258
+
259
+
So, the retry will be performed for each topic according to their configuration values.
260
+
261
+
If you want to provide same/default values for all the topics, then its required to add `default` in the place of topic on the above properties example.
By giving properties like above , the same values will be passed for all the topics and the way of processing retry for all the topics are same.
281
+
243
282
All these above property values are mapped to the classes `DefaultBackOffPolicyProperties.java` and `DefaultRetryPolicyProperties.java` and configured by the class `MessageDefaultRetryConfig.java`.
244
283
245
-
The MessageRetryContext in devon kafka is used to perform the retry pattern with the properties from DefaultBackOffPolicyProperties and DefaultRetryPolicyProperties.
284
+
The MessageRetryContext in devon kafka is used to perform the retry pattern with the properties from DefaultBackOffPolicyProperties and DefaultRetryPolicyProperties.
246
285
247
286
The 2 main properties of MessageRetryContext is nextRetry and retryUntil which is a `Instant` date format and it is calculated internally using the properties given in DefaultBackOffPolicyProperties and DefaultRetryPolicyProperties.
248
287
@@ -259,7 +298,7 @@ Devon4-kafka enqueues a new message for each retry attempt. It is very important
259
298
260
299
=== Handling retry finally failed
261
300
262
-
Per default when the retry fails with final attempt we just log the message and delete the payload of ProducerRecord which comes to proceed the retry pattern.
301
+
Per default when the retry fails with final attempt we just log the message and delete the payload of ProducerRecord which comes to proceed the retry pattern.
263
302
264
303
You can change this behavior by providing the implementation class for the interface `MessageRetryHandler.java`
265
304
which has two method `retryTimeout` and `retryFailedFinal`.
Copy file name to clipboardExpand all lines: modules/kafka/src/main/java/com/devonfw/module/kafka/common/messaging/logging/impl/ProducerLoggingListener.java
Copy file name to clipboardExpand all lines: modules/kafka/src/main/java/com/devonfw/module/kafka/common/messaging/retry/api/client/MessageBackOffPolicy.java
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,17 @@ public interface MessageBackOffPolicy {
16
16
* @param currentRetryCount the count of attempted retry count.
17
17
*
18
18
* @param retryUntilTimestamp the retry until time stamp which requires a Instant in String format.
Copy file name to clipboardExpand all lines: modules/kafka/src/main/java/com/devonfw/module/kafka/common/messaging/retry/api/client/MessageRetryPolicy.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,10 @@ public interface MessageRetryPolicy<K, V> {
38
38
/**
39
39
* This method is used to return the number of retry count.
0 commit comments