Timothy Bish 2014-02-24 16:09:46 -05:00
parent f9451e56e2
commit da72aa6570
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.jms.InvalidClientIDException;
import javax.jms.InvalidSelectorException;
import org.apache.activemq.command.ActiveMQDestination;
@ -426,7 +427,13 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
if (response.isException()) {
Throwable exception = ((ExceptionResponse) response).getException();
if (exception instanceof SecurityException) {
protonConnection.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage()));
} else if (exception instanceof InvalidClientIDException) {
protonConnection.setCondition(new ErrorCondition(AmqpError.INVALID_FIELD, exception.getMessage()));
} else {
protonConnection.setCondition(new ErrorCondition(AmqpError.ILLEGAL_STATE, exception.getMessage()));
}
protonConnection.close();
pumpProtonToSocket();
amqpTransport.onException(IOExceptionSupport.create(exception));