ARTEMIS-3395 ensure sending audit log contains message ID
This commit is contained in:
parent
1d15fb1a3f
commit
bb9bbf062d
|
@ -1777,10 +1777,6 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
||||||
final boolean direct,
|
final boolean direct,
|
||||||
boolean noAutoCreateQueue,
|
boolean noAutoCreateQueue,
|
||||||
RoutingContext routingContext) throws Exception {
|
RoutingContext routingContext) throws Exception {
|
||||||
if (AuditLogger.isMessageEnabled()) {
|
|
||||||
AuditLogger.coreSendMessage(getUsername(), messageParameter.toString(), routingContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
final Message message = LargeServerMessageImpl.checkLargeMessage(messageParameter, storageManager);
|
final Message message = LargeServerMessageImpl.checkLargeMessage(messageParameter, storageManager);
|
||||||
|
|
||||||
if (server.hasBrokerMessagePlugins()) {
|
if (server.hasBrokerMessagePlugins()) {
|
||||||
|
@ -1806,6 +1802,10 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
|
||||||
message.setMessageID(id);
|
message.setMessageID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AuditLogger.isMessageEnabled()) {
|
||||||
|
AuditLogger.coreSendMessage(getUsername(), message.toString(), routingContext);
|
||||||
|
}
|
||||||
|
|
||||||
SimpleString address = message.getAddressSimpleString();
|
SimpleString address = message.getAddressSimpleString();
|
||||||
|
|
||||||
if (defaultAddress == null && address != null) {
|
if (defaultAddress == null && address != null) {
|
||||||
|
|
|
@ -207,6 +207,7 @@ public class AuditLoggerTest extends SmokeTestBase {
|
||||||
Wait.waitFor(() -> addressControl.getMessageCount() == 2);
|
Wait.waitFor(() -> addressControl.getMessageCount() == 2);
|
||||||
Assert.assertEquals(2, addressControl.getMessageCount());
|
Assert.assertEquals(2, addressControl.getMessageCount());
|
||||||
|
|
||||||
|
checkAuditLogRecord(false, "messageID=0");
|
||||||
checkAuditLogRecord(true, "sending a message");
|
checkAuditLogRecord(true, "sending a message");
|
||||||
checkAuditLogRecord(true, uniqueStr);
|
checkAuditLogRecord(true, uniqueStr);
|
||||||
checkAuditLogRecord(true, "Hello2");
|
checkAuditLogRecord(true, "Hello2");
|
||||||
|
|
Loading…
Reference in New Issue