pvillard31 commented on a change in pull request #4939:
URL: https://github.com/apache/nifi/pull/4939#discussion_r607015274
##########
File path:
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java
##########
@@ -55,18 +57,26 @@
*/
abstract class AbstractAMQPProcessor<T extends AMQPWorker> extends
AbstractProcessor {
+ public static final PropertyDescriptor BROKERS = new
PropertyDescriptor.Builder()
+ .name("Brokers")
+ .description("A comma-separated list of known AMQP Brokers in the
format <host>:<port> (e.g., localhost:5672). If this is " +
+ "set, Host Name and Port are ignored. Only include hosts
from the same AMQP cluster.")
+ .required(false)
+
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
+ .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR)
+ .build();
public static final PropertyDescriptor HOST = new
PropertyDescriptor.Builder()
.name("Host Name")
- .description("Network address of AMQP broker (e.g., localhost)")
- .required(true)
+ .description("Network address of AMQP broker (e.g., localhost). If
Brokers is set, then this property is ignored.")
+ .required(false)
.defaultValue("localhost")
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
- .addValidator(StandardValidators.NON_EMPTY_EL_VALIDATOR)
+
.addValidator(StandardValidators.ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR)
Review comment:
Not sure about this change. Could you explain the intent?
##########
File path:
nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AbstractAMQPProcessor.java
##########
@@ -317,7 +330,16 @@ public void
handleUnexpectedConnectionDriverException(Connection conn, Throwable
});
try {
- Connection connection = cf.newConnection(executor);
+ Connection connection;
+ if (context.getProperty(BROKERS).isSet()) {
+ Address[] hostsList = createHostsList(context);
+ connection = cf.newConnection(executor, hostsList);
+ } else {
+
cf.setHost(context.getProperty(BROKERS).evaluateAttributeExpressions().getValue());
Review comment:
This should be ``HOST``, no?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]