mirror of https://github.com/apache/activemq.git
copy message before resend
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@618655 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d0f3d4dce9
commit
c128634fa6
|
@ -23,6 +23,10 @@ import org.apache.activemq.command.Message;
|
|||
import org.apache.activemq.command.ProducerInfo;
|
||||
import org.apache.activemq.state.ProducerState;
|
||||
|
||||
/**
|
||||
* Utility class for re-sending messages
|
||||
*
|
||||
*/
|
||||
public final class BrokerSupport {
|
||||
|
||||
private BrokerSupport() {
|
||||
|
@ -30,17 +34,14 @@ public final class BrokerSupport {
|
|||
|
||||
/**
|
||||
* @param context
|
||||
* @param message
|
||||
* @param originalMessage
|
||||
* @param deadLetterDestination
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void resend(final ConnectionContext context, Message message, ActiveMQDestination deadLetterDestination) throws Exception {
|
||||
if (message.getOriginalDestination() != null) {
|
||||
message.setOriginalDestination(message.getDestination());
|
||||
}
|
||||
if (message.getOriginalTransactionId() != null) {
|
||||
message.setOriginalTransactionId(message.getTransactionId());
|
||||
}
|
||||
public static void resend(final ConnectionContext context, Message originalMessage, ActiveMQDestination deadLetterDestination) throws Exception {
|
||||
Message message = originalMessage.copy();
|
||||
message.setOriginalDestination(message.getDestination());
|
||||
message.setOriginalTransactionId(message.getTransactionId());
|
||||
message.setDestination(deadLetterDestination);
|
||||
message.setTransactionId(null);
|
||||
boolean originalFlowControl = context.isProducerFlowControl();
|
||||
|
|
Loading…
Reference in New Issue