User: dmaplesden
Date: 01/09/19 20:52:57
Modified: src/main/org/jboss/mq/server JMSTopic.java
ClientConsumer.java
Log:
fixed bug for message acknowledgement after receiver closed for topics
Revision Changes Path
1.5 +9 -2 jbossmq/src/main/org/jboss/mq/server/JMSTopic.java
Index: JMSTopic.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/JMSTopic.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JMSTopic.java 2001/08/17 03:04:06 1.4
+++ JMSTopic.java 2001/09/20 03:52:57 1.5
@@ -26,7 +26,7 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author David Maplesden ([EMAIL PROTECTED])
* @created August 16, 2001
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class JMSTopic extends JMSDestination {
@@ -86,7 +86,7 @@
DurableSubcriptionID id = topic.getDurableSubscriptionID();
if ( id == null ) {
synchronized ( tempQueues ) {
- queue = ( BasicQueue )tempQueues.remove( sub );
+ queue = ( BasicQueue )tempQueues.get( sub );
}
} else {
synchronized ( durQueues ) {
@@ -97,6 +97,13 @@
queue.removeSubscriber( sub );
}
+ void cleanupSubscription(Subscription sub){
+ //just try to remove from tempQueues, don't worry if its not there
+ synchronized ( tempQueues ) {
+ tempQueues.remove( sub );
+ }
+ }
+
public void addReceiver( Subscription sub ) {
getQueue( sub ).addReceiver( sub );
}
1.6 +8 -2 jbossmq/src/main/org/jboss/mq/server/ClientConsumer.java
Index: ClientConsumer.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/server/ClientConsumer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ClientConsumer.java 2001/08/29 22:45:58 1.5
+++ ClientConsumer.java 2001/09/20 03:52:57 1.6
@@ -25,7 +25,7 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
* @created August 16, 2001
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ClientConsumer implements Runnable {
//The JMSServer object
@@ -256,8 +256,14 @@
}
void removeRemovedSubscription( int subId ) {
+ Subscription sub = null;
synchronized ( subscriptions ) {
- removedSubscriptions.remove( new Integer( subId ) );
+ sub = (Subscription) removedSubscriptions.remove( new Integer( subId ) );
+ }
+ if(sub != null){
+ JMSDestination topic = server.getJMSDestination( sub.destination );
+ if(topic instanceof JMSTopic)
+ ((JMSTopic) topic).cleanupSubscription(sub);
}
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development