Skip to content

Commit

Permalink
Merge pull request #560 from alcarraz/property-expansion-for-mux-key
Browse files Browse the repository at this point in the history
Allow property expansion for mux keys.
  • Loading branch information
ar authored Aug 18, 2023
2 parents 8febf01 + 85ebb8d commit 39566b1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jpos/src/main/java/org/jpos/q2/iso/QMUX.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ public void initService () throws ConfigurationException {
throw new ConfigurationException ("Misconfigured QMUX. Please verify in/out queues");
}
ignorerc = Environment.get(e.getChildTextTrim ("ignore-rc"));
key = toStringArray(DEFAULT_KEY, ", ", null);
key = toStringArray(e.getChildTextTrim("key"), ", ", DEFAULT_KEY);
returnRejects = cfg.getBoolean("return-rejects", false);
for (Element keyElement : e.getChildren("key")) {
String mtiOverride = QFactory.getAttributeValue(keyElement, "mti");
if (mtiOverride != null && mtiOverride.length() >= 2) {
mtiKey.put (mtiOverride.substring(0,2), toStringArray(keyElement.getTextTrim(), ", ", null));
} else {
key = toStringArray(e.getChildTextTrim("key"), ", ", DEFAULT_KEY);
}
}
ready = toStringArray(Environment.get(e.getChildTextTrim ("ready")));
Expand Down Expand Up @@ -472,10 +470,9 @@ public void dump (PrintStream p, String indent) {
metrics.dump (p, indent);
}
private String[] toStringArray(String s, String delimiter, String def) {
if (s == null)
s = def;
s = (s != null) ? Environment.get(s) : def;
String[] arr = null;
if (s != null && s.length() > 0) {
if (s != null && !s.isEmpty()) {
StringTokenizer st;
if (delimiter != null)
st = new StringTokenizer(s, delimiter);
Expand Down

0 comments on commit 39566b1

Please sign in to comment.