# HG changeset patch # User Dirk Olmes # Date 1599729493 -7200 # Node ID a9675808f1ddd2f4c88a5f281998a82b0551c85d # Parent 4217059d40e85521d101417d933d30f156940b0b Triggern der exception je nach Payload diff -r 4217059d40e8 -r a9675808f1dd spring-jms-playground/src/main/java/de/comline/jms/receiver/QueueReceiver.java --- a/spring-jms-playground/src/main/java/de/comline/jms/receiver/QueueReceiver.java Thu Sep 10 09:32:21 2020 +0200 +++ b/spring-jms-playground/src/main/java/de/comline/jms/receiver/QueueReceiver.java Thu Sep 10 11:18:13 2020 +0200 @@ -19,7 +19,12 @@ } @JmsListener(destination = "validated", containerFactory = Application.AMQ_FACTORY_BEAN) - public void receive(TextMessage message) { + public void receive(TextMessage message) throws Exception { LOG.info("received message {}", message); + + String text = message.getText(); + if (text.contains("kaputt")) { + throw new IllegalStateException("Die Nachricht ist kaputt"); + } } }