From fc8d4318743e0e4ead83c1b0e66e91ae08c8e6e3 Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Wed, 3 Oct 2007 13:04:04 +0000 Subject: Changed to use message.recover instead of message.release git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581589 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/AMQSession_0_10.java | 6 +++--- .../java/org/apache/qpidity/nclient/Session.java | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'java/client/src') diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java index 2b29ed3817..3456124185 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java @@ -248,13 +248,13 @@ public class AMQSession_0_10 extends AMQSession public void sendRecover() throws AMQException, FailoverException { // release all unack messages - RangeSet ranges = new RangeSet(); + /*RangeSet ranges = new RangeSet(); for (long messageTag : _unacknowledgedMessageTags) { // release this message ranges.add(messageTag); - } - getQpidSession().messageRelease(ranges); + }*/ + getQpidSession().messageRecover(Option.REQUEUE); // We need to sync so that we get notify of an error. getQpidSession().sync(); getCurrentException(); diff --git a/java/client/src/main/java/org/apache/qpidity/nclient/Session.java b/java/client/src/main/java/org/apache/qpidity/nclient/Session.java index 52448d3c00..76735f8925 100644 --- a/java/client/src/main/java/org/apache/qpidity/nclient/Session.java +++ b/java/client/src/main/java/org/apache/qpidity/nclient/Session.java @@ -79,7 +79,9 @@ public interface Session // Producer //------------------------------------------------------ /** - * Transfer the given message to a specified exchange. + * Transfer the given + * + * to a specified exchange. *

*

This is a convinience method for providing a complete message * using a single method which internaly is mapped to messageTransfer(), headers() followed @@ -363,6 +365,23 @@ public interface Session */ public void messageReject(RangeSet ranges, int code, String text); + /** + * This method asks the broker to redeliver all unacknowledged messages on a specified session. + * Zero or more messages may be redelivered. This method is only allowed on non-transacted + * sessions. + *

Following are valid options: + *

+ * + * @param _options see available options + */ + public void messageRecover(Option... _options); + + /** * As it is possible that the broker does not manage to reject some messages, after completion of * {@link Session#messageReject} this method will return the ranges of rejected messages. -- cgit v1.2.1