johanhaleby / occurrent

Unintrusive Event Sourcing Library for the JVM
https://occurrent.org
127 stars 16 forks source link

Don't log retry for tx error if write condition is any #157

Open johanhaleby opened 8 months ago

johanhaleby commented 8 months ago

Don't log "Caused by: org.occurrent.eventstore.api.WriteConditionNotFulfilledException: WriteCondition was not fulfilled. Expected version any but was 3."

johanhaleby commented 1 month ago

Caused by: org.occurrent.eventstore.api.WriteConditionNotFulfilledException: WriteCondition was not fulfilled. Expected version any but was 8. at org.occurrent.eventstore.mongodb.internal.MongoExceptionTranslator.translateException(MongoExceptionTranslator.java:58) ~[eventstore-mongodb-common-0.19.5.jar!/:na] at org.occurrent.eventstore.mongodb.spring.blocking.SpringMongoEventStore.insertAll(SpringMongoEventStore.java:312) ~[eventstore-mongodb-spring-blocking-0.19.5.jar!/:na] at org.occurrent.eventstore.mongodb.spring.blocking.SpringMongoEventStore.lambda$write$3(SpringMongoEventStore.java:142) ~[eventstore-mongodb-spring-blocking-0.19.5.jar!/:na] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-6.1.13.jar!/:6.1.13] at org.occurrent.eventstore.mongodb.spring.blocking.SpringMongoEventStore.write(SpringMongoEventStore.java:156) ~[eventstore-mongodb-spring-blocking-0.19.5.jar!/:na] at se.company.EventWriter.write(WriteEvents.kt:36) ~[occurrent-support-1.6.4.jar!/:na] at se.company.EventWriter.write(WriteEvents.kt:25) ~[occurrent-support-1.6.4.jar!/:na] at se.company.History.invoke(Persistence.kt:49) ~[!/:0.0.1-SNAPSHOT] at se.company.History.invoke$default(Persistence.kt:38) ~[!/:0.0.1-SNAPSHOT] at se.company.EventHandler.handleEvent(IngestInvoiceEventsFromRabbitMQ.kt:30) ~[!/:0.0.1-SNAPSHOT] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:169) ~[spring-messaging-6.1.13.jar!/:6.1.13] at org.springframework.amqp.rabbit.listener.adapter.KotlinAwareInvocableHandlerMethod.doInvoke(KotlinAwareInvocableHandlerMethod.java:45) ~[spring-rabbit-3.1.7.jar!/:3.1.7] at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:119) ~[spring-messaging-6.1.13.jar!/:6.1.13] at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.invoke(DelegatingInvocableHandler.java:187) ~[spring-rabbit-3.1.7.jar!/:3.1.7] at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:88) ~[spring-rabbit-3.1.7.jar!/:3.1.7] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:278) ~[spring-rabbit-3.1.7.jar!/:3.1.7] ... 27 common frames omitted