Skip to content

Commit

Permalink
Do not fail on customer not found
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal committed Jan 22, 2024
1 parent b315fbb commit 0119aeb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import io.apicurio.registry.probe.smoke.ProbeMonitoring;
import io.smallrye.reactive.messaging.annotations.Blocking;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.persistence.EntityNotFoundException;
import jakarta.transaction.Transactional;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Message;
Expand Down Expand Up @@ -38,6 +39,9 @@ public CompletionStage<Void> consume(Message<Envelope> customerMessage) {
//Tombstone message, just ack
customerMessage.ack();
}
} catch (EntityNotFoundException enfe) {
log.warn("Customer in message not found: {}", enfe.getCause(), enfe);
return customerMessage.ack();
} catch (Exception e) {
log.error("Exception detected in the Probe application: {}", e.getCause(), e);
return customerMessage.nack(e);
Expand Down

0 comments on commit 0119aeb

Please sign in to comment.