[AMQ-8043] Do not override JMSXUserID when message comes across network connector

This commit is contained in:
Matt Pavlovich 2021-12-24 10:37:17 -06:00
parent 0585a2998d
commit bec734a133
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ public class UserIDBroker extends BrokerFilter {
public void send(ProducerBrokerExchange producerExchange, Message messageSend) throws Exception {
final ConnectionContext context = producerExchange.getConnectionContext();
if(context.isNetworkConnection() && messageSend.getUserID() != null) {
super.send(producerExchange, messageSend);
return;
}
String userID = context.getUserName();
if (isUseAuthenticatePrincipal()) {
SecurityContext securityContext = context.getSecurityContext();