Author: burn Date: Tue May 6 14:54:54 2014 New Revision: 1592765 URL: http://svn.apache.org/r1592765 Log: UIMA-3803 - ignore URL decorations when extracting brokerURL from deployment descriptor
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccUiUtilities.java Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccUiUtilities.java URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccUiUtilities.java?rev=1592765&r1=1592764&r2=1592765&view=diff ============================================================================== --- uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccUiUtilities.java (original) +++ uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccUiUtilities.java Tue May 6 14:54:54 2014 @@ -158,17 +158,23 @@ public class DuccUiUtilities { // locate the <inputQueue node within the xml - should only be one such node, and it MUST exist // then construct an endpoint and resolve any placeholders against the process JVM args // just as is done by Spring in a UIMA-AS Deployment Descriptor + // Ignore any decorations on the broker URL as they are not part of the service name NodeList nodes = doc.getElementsByTagName("inputQueue"); if (nodes.getLength() > 0) { Element element = (Element) nodes.item(0); String endpoint = element.getAttribute("endpoint"); String broker = element.getAttribute("brokerURL"); - String ep = "UIMA-AS:" + endpoint + ":" + broker; - if (ep.contains("${")) { + if (endpoint.contains("${") || broker.contains("${")) { ArrayList<String> jvmargList = QuotedOptions.tokenizeList(jvmargs, true); // Strip quotes Map<String, String> jvmargMap = QuotedOptions.parseAssignments(jvmargList, true); // only -D entries - ep = resolvePlaceholders(ep, jvmargMap); + endpoint = resolvePlaceholders(endpoint, jvmargMap); + broker = resolvePlaceholders(broker, jvmargMap); + } + int i = broker.indexOf('?'); + if (i > 0) { + broker = broker.substring(0, i); } + String ep = "UIMA-AS:" + endpoint + ":" + broker; return ep; } else { throw new IllegalArgumentException("Invalid DD:" + process_DD + ". Missing required element <inputQueue ...");