QPID-8224: [Broker-J][WMC] Add UI to configure exchange unroutable message behaviour for AMQP 1.0
diff --git a/broker-plugins/management-http/src/main/java/resources/addExchange.html b/broker-plugins/management-http/src/main/java/resources/addExchange.html
index e1e9461..bdbb6de 100644
--- a/broker-plugins/management-http/src/main/java/resources/addExchange.html
+++ b/broker-plugins/management-http/src/main/java/resources/addExchange.html
@@ -40,7 +40,7 @@
<div class="formLabel-labelCell">Exchange Type:</div>
<div class="formLabel-controlCell">
<select id="formAddExchange.type"
- dojoType="dijit.form.FilteringSelect"
+ data-dojo-type="dijit.form.FilteringSelect"
data-dojo-props="
name: 'type',
promptMessage: 'Type of exchange - responsible for routing messages to queues'">
@@ -75,7 +75,21 @@
title: 'Select an alternate binding to redirect messages to'"/>
</div>
</div>
-
+ <div class="clear">
+ <div class="formLabel-labelCell">AMQP 1.0 Unroutable Message Behaviour:</div>
+ <div class="formLabel-controlCell">
+ <select id="formAddExchange.unroutableMessageBehaviour"
+ data-dojo-type="dijit.form.FilteringSelect"
+ data-dojo-props="
+ name: 'unroutableMessageBehaviour',
+ required: false,
+ value: null,
+ promptMessage: 'Default behaviour to apply when a message is not routed to any queues'">
+ <option value="DISCARD">DISCARD</option>
+ <option value="REJECT">REJECT</option>
+ </select>
+ </div>
+ </div>
<div class="editorPanel clear"
data-dojo-type="dijit/TitlePane"
data-dojo-props="title: 'Context variables', open: false">
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
index 7ddea2e..ced2a1f 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Exchange.js
@@ -211,7 +211,8 @@
"state",
"durable",
"lifetimePolicy",
- "alternateBinding"]);
+ "alternateBinding",
+ "unroutableMessageBehaviour"]);
that.exchangeData = {};
@@ -257,6 +258,7 @@
this.state.innerHTML = entities.encode(String(this.exchangeData["state"]));
this.durable.innerHTML = entities.encode(String(this.exchangeData["durable"]));
this.lifetimePolicy.innerHTML = entities.encode(String(this.exchangeData["lifetimePolicy"]));
+ this.unroutableMessageBehaviour.innerHTML = entities.encode(String(this.exchangeData["unroutableMessageBehaviour"]));
this.alternateBinding.innerHTML =
this.exchangeData["alternateBinding"] && this.exchangeData["alternateBinding"]["destination"]
? entities.encode(String(this.exchangeData["alternateBinding"]["destination"])) : "";
diff --git a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
index 1a085ce..9ee592d 100644
--- a/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
+++ b/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addExchange.js
@@ -66,6 +66,7 @@
this.exchangeName.set("regExpGen", util.nameOrContextVarRegexp);
this.exchangeType = registry.byId("formAddExchange.type");
this.context = registry.byId("formAddExchange.context");
+ this.unroutableMessageBehaviour = registry.byId("formAddExchange.unroutableMessageBehaviour");
registry.byId("formAddExchange.cancelButton")
.on("click", function (e)
@@ -116,6 +117,9 @@
this.alternateBinding.loadData(management, effectiveData ? modelObj.parent : modelObj);
this.form.reset();
+ var validUnroutableMessageBehaviourValues = this.management.metadata.getMetaData("Exchange","direct").attributes.unroutableMessageBehaviour.validValues;
+ var validUnroutableMessageBehaviourStore = util.makeTypeStore(validUnroutableMessageBehaviourValues);
+ this.unroutableMessageBehaviour.set("store", validUnroutableMessageBehaviourStore);
if (effectiveData)
{
this.effectiveData = effectiveData;
@@ -167,6 +171,15 @@
this.alternateBinding.set("value", alternate.destination);
}
+ if (this.initialData && this.initialData.unroutableMessageBehaviour)
+ {
+ this.unroutableMessageBehaviour.set("value", this.initialData.unroutableMessageBehaviour);
+ }
+ else
+ {
+ this.unroutableMessageBehaviour.set("value", null);
+ }
+ this.unroutableMessageBehaviour.set("required", false);
registry.byId("addExchange").show();
}));
},
diff --git a/broker-plugins/management-http/src/main/java/resources/showExchange.html b/broker-plugins/management-http/src/main/java/resources/showExchange.html
index 1c2c9b5..0e57a40 100644
--- a/broker-plugins/management-http/src/main/java/resources/showExchange.html
+++ b/broker-plugins/management-http/src/main/java/resources/showExchange.html
@@ -42,6 +42,10 @@
<div class="formLabel-labelCell">Lifespan:</div>
<div class="lifetimePolicy formValue-valueCell"></div>
</div>
+ <div class="clear">
+ <div class="formLabel-labelCell">AMQP 1.0 Unroutable Message Behaviour:</div>
+ <div class="unroutableMessageBehaviour formValue-valueCell"></div>
+ </div>
</div>
<div class="alignRight">
<div class="clear">