Fix for AMQ-464

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@366176 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-01-05 13:04:31 +00:00
parent f0454b1e88
commit c68a1460ba
1 changed files with 3 additions and 7 deletions

View File

@ -323,7 +323,7 @@ public class DemandForwardingBridge implements Bridge {
} }
protected void serviceLocalCommand(Command command) { protected void serviceLocalCommand(Command command) {
boolean trace = log.isTraceEnabled(); final boolean trace = log.isTraceEnabled();
try { try {
if( command.isMessageDispatch() ) { if( command.isMessageDispatch() ) {
MessageDispatch md = (MessageDispatch) command; MessageDispatch md = (MessageDispatch) command;
@ -349,12 +349,8 @@ public class DemandForwardingBridge implements Bridge {
log.trace("bridging " + localBroker + " -> " + remoteBroker + ": "+message); log.trace("bridging " + localBroker + " -> " + remoteBroker + ": "+message);
remoteBroker.oneway( message ); remoteBroker.oneway( message );
localBroker.oneway(new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, demandConsumerDispatched));
sub.dispatched++;
if( sub.dispatched > (sub.localInfo.getPrefetchSize()*.75) ) {
localBroker.oneway(new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, demandConsumerDispatched));
sub.dispatched=0;
}
} }
} else if ( command.isBrokerInfo() ) { } else if ( command.isBrokerInfo() ) {
synchronized( this ) { synchronized( this ) {