micronaut-projects / micronaut-kafka

Integration between Micronaut and Apache Kafka
Apache License 2.0
83 stars 104 forks source link

Add RETRY_CONDITIONALLY_ON_ERROR and RETRY_CONDITIONALLY_EXPONENTIALLY_ON_ERROR KafkaListener error strategies to conditionally retry messages #946

Closed MRyanEvans closed 7 months ago

MRyanEvans commented 8 months ago

Potential solution for https://github.com/micronaut-projects/micronaut-kafka/issues/947.

Adds RETRY_CONDITIONALLY_ON_ERROR and RETRY_CONDITIONALLY_EXPONENTIALLY_ON_ERROR listener error stratiegies to conditionally retry messages on error.

CLAassistant commented 8 months ago

CLA assistant check
All committers have signed the CLA.

MRyanEvans commented 8 months ago

First, I assume that you've already determined you can't achieve what you're looking for by specifying the specific exception types to retry via the exceptionTypes annotation field?

Yes, unfortunately the exceptions that we're dealing with -- schema registry HTTP client exceptions -- are nested quite deeply and we need to inspect the exception body to determine whether it is transient or not.

Thanks for the feedback, I agree that a different error strategy would be a safer and better solution. I'll have a crack at it.

MRyanEvans commented 7 months ago

Right, I've kept the behaviour of the existing strategies as-is and have added additional strategies that will conditionally retry.

For the @since Javadoc tags, I guessed that the next version would be 5.4.0 but I can change it as needed.

jeremyg484 commented 7 months ago

Right, I've kept the behaviour of the existing strategies as-is and have added additional strategies that will conditionally retry.

Awesome, I'll give it a proper review in the next couple days.

For the @since Javadoc tags, I guessed that the next version would be 5.4.0 but I can change it as needed.

I believe that's correct.

MRyanEvans commented 7 months ago

Excellent, cheers. When can we expect the merge/release?

jeremyg484 commented 7 months ago

Excellent, cheers. When can we expect the merge/release?

I'll get it merged shortly.

As it's an enhancement to an existing feature, it should be included in the next Micronaut Platform minor release 4.4.0 (which will of course include a new minor release of this module). I'm not certain of the current target, but my guess would be those releases will occur within the next month or so as that's roughly the cadence we've been keeping.

sdelamo commented 7 months ago

@jeremyg484 You can see the target date in the projects: https://github.com/orgs/micronaut-projects/projects

We aim for March 19 for 4.4.0