ARTEMIS-539 fixing default address on client as well

This commit is contained in:
Clebert Suconic 2016-06-03 11:59:09 -04:00
parent 14516af7c7
commit 17ea05bce6
2 changed files with 7 additions and 2 deletions

View File

@ -1054,9 +1054,11 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
if (defaultAddress == null) { if (defaultAddress == null) {
defaultAddress = address; defaultAddress = address;
message.setAddress(address); if (message != null) {
message.setAddress(address);
}
} }
else { else if (message != null) {
if (!address.equals(defaultAddress)) { if (!address.equals(defaultAddress)) {
message.setAddress(address); message.setAddress(address);
} }
@ -1085,6 +1087,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
@Override @Override
public synchronized ClientProducerCredits getCredits(final SimpleString address, final boolean anon) { public synchronized ClientProducerCredits getCredits(final SimpleString address, final boolean anon) {
setAddress(null, address);
ClientProducerCredits credits = producerCreditManager.getCredits(address, anon, sessionContext); ClientProducerCredits credits = producerCreditManager.getCredits(address, anon, sessionContext);
return credits; return credits;

View File

@ -1268,7 +1268,9 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
} }
protected void checkDefaultAddress(SimpleString address) { protected void checkDefaultAddress(SimpleString address) {
logger.tracef("checkDefaultAddress %s, defaultAddress=%s", address, defaultAddress);
if (defaultAddress == null && address != null) { if (defaultAddress == null && address != null) {
logger.tracef("checkDefaultAddress setting as %s", address);
defaultAddress = address; defaultAddress = address;
} }
} }