-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to requeue message on client runtime exception
Requeuing a message after a client RuntimeException complies to the JMS specification. Nevertheless, the default behavior is still the same: the message is "lost" (as it has been AMQP-acknowledged before the delivery to the client) if the client fails to process it (which makes more sense to us). The option is RMQConnectionFactory#requeueOnMessageListenerException and is false by default. Fixes #23
- Loading branch information
1 parent
d91af11
commit 229a051
Showing
10 changed files
with
269 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/rabbitmq/jms/client/RMQMessageListenerExecutionJMSException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* Copyright (c) 2017 Pivotal Software, Inc. All rights reserved. */ | ||
package com.rabbitmq.jms.client; | ||
|
||
import javax.jms.JMSException; | ||
|
||
/** | ||
* Wraps an execution exception as a {@link JMSException}. | ||
*/ | ||
public class RMQMessageListenerExecutionJMSException extends JMSException { | ||
|
||
/** Default version ID */ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public RMQMessageListenerExecutionJMSException(String msg, Throwable x) { | ||
this(msg, null, x); | ||
} | ||
|
||
public RMQMessageListenerExecutionJMSException(Throwable x) { | ||
this(x.getMessage(), x); | ||
} | ||
|
||
private RMQMessageListenerExecutionJMSException(String msg, String errorCode, Throwable x) { | ||
super(msg, errorCode); | ||
this.initCause(x); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.