send back responses

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@371910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-01-24 13:34:59 +00:00
parent 4b8822f154
commit fd156f833a
1 changed files with 22 additions and 13 deletions

View File

@ -26,8 +26,10 @@ import org.apache.activemq.command.Command;
import org.apache.activemq.command.CommandTypes; import org.apache.activemq.command.CommandTypes;
import org.apache.activemq.command.ConnectionId; import org.apache.activemq.command.ConnectionId;
import org.apache.activemq.command.ConnectionInfo; import org.apache.activemq.command.ConnectionInfo;
import org.apache.activemq.command.ExceptionResponse;
import org.apache.activemq.command.MessageDispatch; import org.apache.activemq.command.MessageDispatch;
import org.apache.activemq.command.ProducerInfo; import org.apache.activemq.command.ProducerInfo;
import org.apache.activemq.command.Response;
import org.apache.activemq.command.SessionInfo; import org.apache.activemq.command.SessionInfo;
import org.apache.activemq.command.ShutdownInfo; import org.apache.activemq.command.ShutdownInfo;
import org.apache.activemq.transport.Transport; import org.apache.activemq.transport.Transport;
@ -179,7 +181,14 @@ public class MasterConnector implements Service{
shutDown(); shutDown();
}else{ }else{
boolean responseRequired = command.isResponseRequired();
short commandId = command.getCommandId();
localBroker.oneway(command); localBroker.oneway(command);
if (responseRequired){
Response response=new Response();
response.setCorrelationId(commandId);
remoteBroker.oneway(response);
}
} }
}catch(IOException e){ }catch(IOException e){
serviceRemoteException(e); serviceRemoteException(e);
@ -224,6 +233,6 @@ public class MasterConnector implements Service{
private void shutDown(){ private void shutDown(){
masterActive.set(false); masterActive.set(false);
broker.masterFailed(); broker.masterFailed();
ServiceSupport.dispose(this); //ServiceSupport.dispose(this);
} }
} }