mirror of
https://github.com/apache/nifi.git
synced 2025-02-10 12:05:22 +00:00
NIFI-6917 - fix doc for dynamic properties variables support in JMS Connection Factory Provider
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #3914
This commit is contained in:
parent
1898ad44be
commit
41fef551c3
@ -63,7 +63,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
@DynamicProperty(name = "The name of a Connection Factory configuration property.", value = "The value of a given Connection Factory configuration property.",
|
@DynamicProperty(name = "The name of a Connection Factory configuration property.", value = "The value of a given Connection Factory configuration property.",
|
||||||
description = "The properties that are set following Java Beans convention where a property name is derived from the 'set*' method of the vendor "
|
description = "The properties that are set following Java Beans convention where a property name is derived from the 'set*' method of the vendor "
|
||||||
+ "specific ConnectionFactory's implementation. For example, 'com.ibm.mq.jms.MQConnectionFactory.setChannel(String)' would imply 'channel' "
|
+ "specific ConnectionFactory's implementation. For example, 'com.ibm.mq.jms.MQConnectionFactory.setChannel(String)' would imply 'channel' "
|
||||||
+ "property and 'com.ibm.mq.jms.MQConnectionFactory.setTransportType(int)' would imply 'transportType' property.")
|
+ "property and 'com.ibm.mq.jms.MQConnectionFactory.setTransportType(int)' would imply 'transportType' property.",
|
||||||
|
expressionLanguageScope = ExpressionLanguageScope.VARIABLE_REGISTRY)
|
||||||
@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS"})
|
@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS"})
|
||||||
public class JMSConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition {
|
public class JMSConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition {
|
||||||
|
|
||||||
@ -134,6 +135,7 @@ public class JMSConnectionFactoryProvider extends AbstractControllerService impl
|
|||||||
+ "' property to be set on the provided ConnectionFactory implementation.")
|
+ "' property to be set on the provided ConnectionFactory implementation.")
|
||||||
.name(propertyDescriptorName)
|
.name(propertyDescriptorName)
|
||||||
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
|
.addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
|
||||||
|
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
|
||||||
.dynamic(true)
|
.dynamic(true)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -480,6 +480,25 @@ public class JMSConnectionFactoryProviderTest {
|
|||||||
|
|
||||||
runner.enableControllerService(cfProvider);
|
runner.enableControllerService(cfProvider);
|
||||||
|
|
||||||
assertEquals(cfProvider.getSetProperties(), ImmutableMap.of("connectionNameList", HOSTNAME+"("+PORT+")"));
|
assertEquals(cfProvider.getSetProperties(), ImmutableMap.of("connectionNameList", HOSTNAME + "(" + PORT + ")"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void dynamicPropertiesSetOnSingleTestBrokerConnectionFactory() throws InitializationException {
|
||||||
|
TestRunner runner = TestRunners.newTestRunner(mock(Processor.class));
|
||||||
|
|
||||||
|
JMSConnectionFactoryProviderForTest cfProvider = new JMSConnectionFactoryProviderForTest();
|
||||||
|
runner.addControllerService(controllerServiceId, cfProvider);
|
||||||
|
|
||||||
|
runner.setVariable("test", "dynamicValue");
|
||||||
|
|
||||||
|
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.BROKER_URI, SINGLE_TEST_BROKER);
|
||||||
|
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CLIENT_LIB_DIR_PATH, dummyResource);
|
||||||
|
runner.setProperty(cfProvider, JMSConnectionFactoryProvider.CONNECTION_FACTORY_IMPL, TEST_CONNECTION_FACTORY_IMPL);
|
||||||
|
runner.setProperty(cfProvider, "dynamicProperty", "${test}");
|
||||||
|
|
||||||
|
runner.enableControllerService(cfProvider);
|
||||||
|
|
||||||
|
assertEquals(cfProvider.getSetProperties(), ImmutableMap.of("dynamicProperty", "dynamicValue", "hostName", HOSTNAME, "port", PORT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user