I am making a microservice based architecture and I'm actively seeking antipatterns and trying to avoid them. In multiple scenarios, I have a database commit followed by a message that is produced to Kafka (but it could be any message broker, really).
If the db commit fails, an error is returned as one would expect. If the Kafka message produce fails, is it an antipattern to keep retrying the produce (which may introduce some other datastore to have this resiliency)?
Or should I undo the db transaction and return an error?