vkcelik commented on a change in pull request #3246: NIFI-5929 Support for IBM MQ multi-instance queue managers URL: https://github.com/apache/nifi/pull/3246#discussion_r245968943
########## File path: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JMSConnectionFactoryProvider.java ########## @@ -210,17 +218,23 @@ private void setConnectionFactoryProperties(ConfigurationContext context) { if (descriptor.isDynamic()) { this.setProperty(propertyName, entry.getValue()); } else { - if (propertyName.equals(BROKER)) { - String brokerValue = context.getProperty(descriptor).evaluateAttributeExpressions().getValue(); - if (context.getProperty(CONNECTION_FACTORY_IMPL).evaluateAttributeExpressions().getValue().startsWith("org.apache.activemq")) { + if (descriptor == BROKER_URI) { + String brokerValue = context.getProperty(BROKER_URI).evaluateAttributeExpressions().getValue(); + String connectionFactoryValue = context.getProperty(CONNECTION_FACTORY_IMPL).evaluateAttributeExpressions().getValue(); + if (connectionFactoryValue.startsWith("org.apache.activemq")) { this.setProperty("brokerURL", brokerValue); + } else if (connectionFactoryValue.startsWith("com.tibco.tibjms")) { + this.setProperty("serverUrl", brokerValue); } else { + // Try to parse broker URI as colon separated host/port pair String[] hostPort = brokerValue.split(":"); + // If broker URI indeed was colon separated host/port pair if (hostPort.length == 2) { this.setProperty("hostName", hostPort[0]); this.setProperty("port", hostPort[1]); - } else if (hostPort.length != 2) { - this.setProperty("serverUrl", brokerValue); // for tibco + } else if (connectionFactoryValue.startsWith("com.ibm.mq.jms")) { + // Assuming IBM MQ style broker was specified, e.g. "myhost(1414)" and "myhost01(1414),myhost02(1414)" + this.setProperty("connectionNameList", brokerValue); Review comment: The following two quotes are both from the same [IBM page](https://www.ibm.com/support/knowledgecenter/en/SSAW57_9.0.0/com.ibm.websphere.nd.multiplatform.doc/ae/umj_pasm.html): > Connection name lists can be used to connect to a single queue manager or to a multi-instance queue manager > This property (connection name list) must only be used to allow connection to a multi-instance queue manager. It must not be used to allow connections to non-multi-instance queue managers as that can result in transaction integrity issues. I think these quotes contradict each other regarding whether connection name list should be used for single queue manager (broker), but it would be safest to not use it Furthermore it says: > If 'Enter host and port information in the form of separate host and port values' is selected, the connection name list property cannot be used and the following properties can be used: ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services