NIFI-5810 Add UserName EL support to JMS processors

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #3164.
This commit is contained in:
Ed B 2018-11-09 19:27:10 -05:00 committed by Pierre Villard
parent 830f7aa84d
commit 878a0b8b74
1 changed files with 3 additions and 2 deletions

View File

@ -59,7 +59,8 @@ abstract class AbstractJMSProcessor<T extends JMSWorker> extends AbstractProcess
.name("User Name")
.description("User Name used for authentication and authorization.")
.required(false)
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
.addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
.build();
static final PropertyDescriptor PASSWORD = new PropertyDescriptor.Builder()
.name("Password")
@ -205,7 +206,7 @@ abstract class AbstractJMSProcessor<T extends JMSWorker> extends AbstractProcess
final UserCredentialsConnectionFactoryAdapter cfCredentialsAdapter = new UserCredentialsConnectionFactoryAdapter();
cfCredentialsAdapter.setTargetConnectionFactory(connectionFactory);
cfCredentialsAdapter.setUsername(context.getProperty(USER).getValue());
cfCredentialsAdapter.setUsername(context.getProperty(USER).evaluateAttributeExpressions().getValue());
cfCredentialsAdapter.setPassword(context.getProperty(PASSWORD).getValue());
final CachingConnectionFactory cachingFactory = new CachingConnectionFactory(cfCredentialsAdapter);