Merge pull request #742 from mattrpav/AMQ-8053

[AMQ-8053] Do not override JMSXUserID over network connections
This commit is contained in:
Jean-Baptiste Onofré 2022-01-15 06:47:48 +01:00 committed by GitHub
commit 0508c22481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();