diff --git a/deps/rabbitmq_management/priv/www/js/global.js b/deps/rabbitmq_management/priv/www/js/global.js
index 406e5dc7b8b6..03e6c78bb8e6 100644
--- a/deps/rabbitmq_management/priv/www/js/global.js
+++ b/deps/rabbitmq_management/priv/www/js/global.js
@@ -223,7 +223,7 @@ var HELP = {
'Optional replacement routing key to use when a message is dead-lettered. If this is not set, the message\'s original routing key will be used. (Sets the "x-dead-letter-routing-key " argument.)',
'queue-dead-letter-strategy':
- 'Valid values are at-most-once or at-least-once. It defaults to at-most-once. This setting is understood only by quorum queues. If at-least-once is set, Overflow behaviour must be set to reject-publish. Otherwise, dead letter strategy will fall back to at-most-once.',
+ 'Valid values are at-most-once or at-least-once. It defaults to at-most-once. If at-least-once is set, Overflow behaviour must be set to reject-publish. Otherwise, dead letter strategy will fall back to at-most-once.',
'queue-single-active-consumer':
'If set, makes sure only one consumer at a time consumes from the queue and fails over to another registered consumer in case the active one is cancelled or dies. (Sets the "x-single-active-consumer " argument.)',
@@ -235,7 +235,10 @@ var HELP = {
'Sets the data retention for stream queues in time units (Y=Years, M=Months, D=Days, h=hours, m=minutes, s=seconds). E.g. "1h" configures the stream to only keep the last 1 hour of received messages.(Sets the x-max-age argument.)',
'queue-overflow':
- 'Sets the queue overflow behaviour . This determines what happens to messages when the maximum length of a queue is reached. Valid values are drop-head, reject-publish or reject-publish-dlx. The quorum queue type only supports drop-head and reject-publish.',
+ 'Sets the queue overflow behaviour . This determines what happens to messages when the maximum length of a queue is reached. Valid values are drop-head, reject-publish or reject-publish-dlx',
+
+ 'quorum-queue-overflow':
+ 'Sets the queue overflow behaviour . This determines what happens to messages when the maximum length of a queue is reached. Valid values for quorum queues are drop-head and reject-publish.',
'queue-master-locator':
'Deprecated: please use `queue-leader-locator` instead. Controls which node the queue will be running on. ',
@@ -887,3 +890,217 @@ var chart_data = {};
var last_page_out_of_range_error = 0;
var oauth;
+
+
+///////////////////////////////////////////////////////////////////////////
+// //
+// Queue types //
+// //
+///////////////////////////////////////////////////////////////////////////
+
+/// this queue types are very well known to the server, at the very least
+/// this collection must be validated in terms of matching server queue
+/// types registry. I hope I will have time for this.
+var QUEUE_TYPE = function (queue) {
+ return QUEUE_TYPE[get_queue_type(queue)];
+}
+// TODO: while this allows for custom queues
+// the proper way is to follow single source of truth
+// and generate most of this on the server from queue type metadata
+// including replacing tmpl's with data-driven generators
+// For example server knows policy_apply_to for each queue
+// and it knows what extra agruments each queue type accepts.
+// So for the latter case we dont' need a template that lists
+// queue args. We need iterator over server-supplied object.
+QUEUE_TYPE["default"] = {
+ label: "Default",
+ params: {},
+ policy_apply_to: "classic_queue",
+ actions: {
+ get_message: true,
+ purge: true
+ },
+ tmpl: {
+ "arguments" : "classic-queue-arguments",
+ // TODO: this must be generated from js objects of course.
+ // and then those objects must be rendered by the server
+ "user_policy_arguments": "classic-queue-user-policy-arguments",
+ "operator_policy_arguments": "classic-queue-operator-policy-arguments",
+ "list" : "classic-queue-list",
+ "stats" : "classic-queue-stats",
+ "node_details" : "classic-queue-node-details"
+ }
+};
+
+QUEUE_TYPE["classic"] = {
+ label: "Classic",
+ params: {},
+ policy_apply_to: "classic_queue",
+ actions: {
+ get_message: true,
+ purge: true
+ },
+ tmpl: {
+ "arguments" : "classic-queue-arguments",
+ "user_policy_arguments": "classic-queue-user-policy-arguments",
+ "operator_policy_arguments": "classic-queue-operator-policy-arguments",
+ "list" : "classic-queue-list",
+ "stats" : "classic-queue-stats",
+ "node_details" : "classic-queue-node-details"
+ }
+};
+
+QUEUE_TYPE["quorum"] = {
+ label: "Quorum",
+ params: {
+ 'durable': true,
+ 'auto_delete': false
+ },
+ policy_apply_to: "quorum_queues",
+ actions: {
+ get_message: true,
+ purge: true
+ },
+ tmpl: {
+ "arguments" : "quorum-queue-arguments",
+ "user_policy_arguments": "quorum-queue-user-policy-arguments",
+ "operator_policy_arguments": "quorum-queue-operator-policy-arguments",
+ "list" : "quorum-queue-list",
+ "stats": "quorum-queue-stats",
+ "node_details" : "quorum-queue-node-details"
+ }
+};
+
+QUEUE_TYPE["stream"] = {
+ label: "Stream",
+ params: {
+ 'durable': true,
+ 'auto_delete': false
+ },
+ policy_apply_to: "streams",
+ actions: {
+ get_message: false,
+ purge: false
+ },
+ tmpl: {
+ "arguments" : "stream-queue-arguments",
+ "user_policy_arguments": "quorum-queue-user-policy-arguments",
+ "operator_policy_arguments": "stream-queue-operator-policy-arguments",
+ "list" : "stream-queue-list",
+ "stats" : "stream-queue-stats",
+ "node_details" : "stream-queue-node-details"
+ }
+};
+
+// here I'll shortcut for now and let it be like that
+// other queue types can inject themlves where they want.
+// since the 'sections' object will likely keep key insertion
+// order custom keys for queue type will be coming last.
+
+// maybe add helper functions?
+var MEMORY_STATISTICS = {
+ sections: {'queue_procs' : ['classic', 'Classic queues'],
+ 'quorum_queue_procs' : ['quorum', 'Quorum queues'],
+ 'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
+ 'stream_queue_procs' : ['stream', 'Stream queues'],
+ 'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
+ 'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
+ 'binary' : ['binary', 'Binaries'],
+ 'connection_readers' : ['conn', 'Connection readers'],
+ 'connection_writers' : ['conn', 'Connection writers'],
+ 'connection_channels' : ['conn', 'Connection channels'],
+ 'connection_other' : ['conn', 'Connections (other)'],
+ 'mnesia' : ['table', 'Mnesia'],
+ 'msg_index' : ['table', 'Message store index'],
+ 'mgmt_db' : ['table', 'Management database'],
+ 'quorum_ets' : ['table', 'Quorum queue ETS tables'],
+ 'other_ets' : ['table', 'Other ETS tables'],
+ 'plugins' : ['proc', 'Plugins'],
+ 'other_proc' : ['proc', 'Other process memory'],
+ 'code' : ['system', 'Code'],
+ 'atom' : ['system', 'Atoms'],
+ 'other_system' : ['system', 'Other system'],
+ 'allocated_unused' : ['unused', 'Allocated unused'],
+ 'reserved_unallocated': ['unused', 'Unallocated reserved by the OS']},
+ keys: [[{name: 'Classic Queues', colour: 'classic',
+ keys: [['queue_procs', 'queues']]},
+ {name: 'Quorum Queues', colour: 'quorum',
+ keys: [['quorum_queue_procs','quorum'],
+ ['quorum_queue_dlx_procs', 'dead letter workers']]},
+ {name: 'Streams', colour: 'stream',
+ keys: [['stream_queue_procs', 'stream'],
+ ['stream_queue_replica_reader_procs', 'stream replica reader'],
+ ['stream_queue_coordinator_procs', 'stream coordinator']]},
+ {name: 'Binaries', colour: 'binary',
+ keys: [['binary', '']]}],
+
+ [{name: 'Connections', colour: 'conn',
+ keys: [['connection_readers', 'readers'],
+ ['connection_writers', 'writers'],
+ ['connection_channels', 'channels'],
+ ['connection_other', 'other']]}],
+
+ [{name: 'Tables', colour: 'table',
+ keys: [['mnesia', 'internal database tables'],
+ ['msg_index', 'message store index'],
+ ['mgmt_db', 'management database'],
+ ['quorum_ets', 'quorum queue tables'],
+ ['other_ets', 'other']]}],
+
+ [{name: 'Processes', colour: 'proc',
+ keys: [['plugins', 'plugins'],
+ ['metadata_store', 'metadata store'],
+ ['other_proc', 'other']]},
+ {name: 'System', colour: 'system',
+ keys: [['code', 'code'],
+ ['atom', 'atoms'],
+ ['other_system', 'other']
+ ]}],
+
+ [{name: 'Preallocated memory', colour: 'unused',
+ keys: [['allocated_unused', 'preallocated by runtime, unused'],
+ ['reserved_unallocated', 'unallocated, reserved by the OS']]}]]
+}
+
+var BINARY_STATISTICS = {
+ sections: {'queue_procs' : ['classic', 'Classic queues'],
+ 'quorum_queue_procs' : ['quorum', 'Quorum queues'],
+ 'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
+ 'stream_queue_procs' : ['stream', 'Stream queues'],
+ 'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
+ 'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
+ 'connection_readers' : ['conn', 'Connection readers'],
+ 'connection_writers' : ['conn', 'Connection writers'],
+ 'connection_channels' : ['conn', 'Connection channels'],
+ 'connection_other' : ['conn', 'Connections (other)'],
+ 'msg_index' : ['table', 'Message store index'],
+ 'mgmt_db' : ['table', 'Management database'],
+ 'plugins' : ['proc', 'Plugins'],
+ 'metadata_store' : ['metadata_store', 'Metadata store'],
+ 'other' : ['system', 'Other binary references']},
+ key: [[{name: 'Classic Queues', colour: 'classic',
+ keys: [['queue_procs', 'queues']]},
+ {name: 'Quorum Queues', colour: 'quorum',
+ keys: [['quorum_queue_procs', 'quorum'],
+ ['quorum_queue_dlx_procs', 'dead letter workers']]},
+ {name: 'Streams', colour: 'stream',
+ keys: [['stream_queue_procs', 'stream'],
+ ['stream_queue_replica_reader_procs', 'stream replica reader'],
+ ['stream_queue_coordinator_procs', 'stream coordinator']]}],
+
+ [{name: 'Connections', colour: 'conn',
+ keys: [['connection_readers', 'readers'],
+ ['connection_writers', 'writers'],
+ ['connection_channels', 'channels'],
+ ['connection_other', 'other']]}],
+
+ [{name: 'Tables', colour: 'table',
+ keys: [['msg_index', 'message store index'],
+ ['mgmt_db', 'management database']]}],
+
+ [{name: 'Processes', colour: 'proc',
+ keys: [['plugins', 'plugins'],
+ ['metadata_store', 'metadata store']]},
+ {name: 'System', colour: 'system',
+ keys: [['other', 'other']]}]]
+};
diff --git a/deps/rabbitmq_management/priv/www/js/main.js b/deps/rabbitmq_management/priv/www/js/main.js
index c69b0be945b4..bfa363f57be1 100644
--- a/deps/rabbitmq_management/priv/www/js/main.js
+++ b/deps/rabbitmq_management/priv/www/js/main.js
@@ -1578,11 +1578,8 @@ function collapse_multifields(params0) {
if (queue_type != 'default') {
params['arguments']['x-queue-type'] = queue_type;
}
- if (queue_type == 'quorum' ||
- queue_type == 'stream') {
- params['durable'] = true;
- params['auto_delete'] = false;
- }
+
+ params = Object.assign(params, QUEUE_TYPE[queue_type].params)
}
return params;
}
@@ -1759,6 +1756,10 @@ function select_queue_type(queuetype) {
update();
}
+function is_internal(queue) {
+ return queue.internal;
+}
+
function get_queue_type (queue) {
return queue.type;
}
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/binary.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/binary.ejs
index 19a0f7ea9a0e..815ee3c960fd 100644
--- a/deps/rabbitmq_management/priv/www/js/tmpl/binary.ejs
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/binary.ejs
@@ -5,56 +5,14 @@
Binary statistics not available.
<% } else { %>
-<%
- var sections = {'queue_procs' : ['classic', 'Classic queues'],
- 'quorum_queue_procs' : ['quorum', 'Quorum queues'],
- 'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
- 'stream_queue_procs' : ['stream', 'Stream queues'],
- 'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
- 'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
- 'connection_readers' : ['conn', 'Connection readers'],
- 'connection_writers' : ['conn', 'Connection writers'],
- 'connection_channels' : ['conn', 'Connection channels'],
- 'connection_other' : ['conn', 'Connections (other)'],
- 'msg_index' : ['table', 'Message store index'],
- 'mgmt_db' : ['table', 'Management database'],
- 'plugins' : ['proc', 'Plugins'],
- 'metadata_store' : ['metadata_store', 'Metadata store'],
- 'other' : ['system', 'Other binary references']};
- var total_out = [];
-%>
-<%= format('memory-bar', {sections: sections, memory: binary, total_out: total_out}) %>
-
-
-<%
-var key = [[{name: 'Classic Queues', colour: 'classic',
- keys: [['queue_procs', 'queues']]},
- {name: 'Quorum Queues', colour: 'quorum',
- keys: [['quorum_queue_procs', 'quorum'],
- ['quorum_queue_dlx_procs', 'dead letter workers']]},
- {name: 'Streams', colour: 'stream',
- keys: [['stream_queue_procs', 'stream'],
- ['stream_queue_replica_reader_procs', 'stream replica reader'],
- ['stream_queue_coordinator_procs', 'stream coordinator']]}],
-
- [{name: 'Connections', colour: 'conn',
- keys: [['connection_readers', 'readers'],
- ['connection_writers', 'writers'],
- ['connection_channels', 'channels'],
- ['connection_other', 'other']]}],
-
- [{name: 'Tables', colour: 'table',
- keys: [['msg_index', 'message store index'],
- ['mgmt_db', 'management database']]}],
-
- [{name: 'Processes', colour: 'proc',
- keys: [['plugins', 'plugins'],
- ['metadata_store', 'metadata store']]},
- {name: 'System', colour: 'system',
- keys: [['other', 'other']]}]];
-%>
-<%= format('memory-table', {key: key, memory: binary}) %>
-
+ <%
+ var total_out = [];
+ %>
+ <%= format('memory-bar', {sections: BINARY_STATISTICS.sections, memory: binary, total_out: total_out}) %>
+
+
+ <%= format('memory-table', {key: BINARY_STATISTICS. key, memory: binary}) %>
+
Last updated:
<%= fmt_date(new Date()) %> .
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-arguments.ejs
new file mode 100644
index 000000000000..ff3d60c32a5a
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-arguments.ejs
@@ -0,0 +1,10 @@
+
Auto expire |
+
Message TTL |
+
Overflow behaviour
+
Single active consumer |
+
Dead letter exchange |
+
Dead letter routing key
+
Max length |
+
Max length bytes
+ |
Maximum priority
+ |
Leader locator
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-node-details.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-node-details.ejs
new file mode 100644
index 000000000000..eaefb2fd4b07
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-node-details.ejs
@@ -0,0 +1,4 @@
+
+ Node
+ <%= fmt_node(queue.node) %>
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-operator-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-operator-policy-arguments.ejs
new file mode 100644
index 000000000000..116131fee3e8
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-operator-policy-arguments.ejs
@@ -0,0 +1,11 @@
+
+ Queues [Classic]
+
+ Auto expire |
+ Max length |
+ Max length bytes |
+ Message TTL |
+ |
+ Length limit overflow behaviour
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-stats.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-stats.ejs
new file mode 100644
index 000000000000..d779d6cca7ff
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-stats.ejs
@@ -0,0 +1,94 @@
+
+
+ State
+ <%= fmt_object_state(queue) %>
+
+ <% if(queue.consumers) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumers) %>
+
+ <% } else if(queue.hasOwnProperty('consumer_details')) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumer_details.length) %>
+
+ <% } %>
+
+ Consumer capacity
+ <%= fmt_percent(queue.consumer_capacity) %>
+
+ <% if(queue.hasOwnProperty('publishers')) { %>
+
+ Publishers
+ <%= fmt_string(queue.publishers) %>
+
+ <% } %>
+
+
+
+
+
+ Total
+ Ready
+ Unacked
+ In memory
+ Persistent
+ Transient, Paged Out
+
+
+
+ Messages
+
+
+
+ <%= fmt_num_thousands(queue.messages) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ready) %>
+
+
+ <%= fmt_num_thousands(queue.messages_unacknowledged) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ram) %>
+
+
+ <%= fmt_num_thousands(queue.messages_persistent) %>
+
+
+ <%= fmt_num_thousands(queue.messages_paged_out) %>
+
+
+
+
+ Message body bytes
+
+
+
+ <%= fmt_bytes(queue.message_bytes) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_ready) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_unacknowledged) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_ram) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_persistent) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_paged_out) %>
+
+
+
+
+ Process memory
+
+
+ <%= fmt_bytes(queue.memory) %>
+
+
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-user-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/classic-queue-user-policy-arguments.ejs
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs
index 03c442329983..bbded7589e11 100644
--- a/deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/memory.ejs
@@ -5,75 +5,10 @@
Memory statistics not available.
<% } else { %>
-<%
- var sections = {'queue_procs' : ['classic', 'Classic queues'],
- 'quorum_queue_procs' : ['quorum', 'Quorum queues'],
- 'quorum_queue_dlx_procs' : ['quorum', 'Dead letter workers'],
- 'stream_queue_procs' : ['stream', 'Stream queues'],
- 'stream_queue_replica_reader_procs' : ['stream', 'Stream queues (replica reader)'],
- 'stream_queue_coordinator_procs' : ['stream', 'Stream queues (coordinator)'],
- 'binary' : ['binary', 'Binaries'],
- 'connection_readers' : ['conn', 'Connection readers'],
- 'connection_writers' : ['conn', 'Connection writers'],
- 'connection_channels' : ['conn', 'Connection channels'],
- 'connection_other' : ['conn', 'Connections (other)'],
- 'mnesia' : ['table', 'Mnesia'],
- 'msg_index' : ['table', 'Message store index'],
- 'mgmt_db' : ['table', 'Management database'],
- 'quorum_ets' : ['table', 'Quorum queue ETS tables'],
- 'other_ets' : ['table', 'Other ETS tables'],
- 'plugins' : ['proc', 'Plugins'],
- 'other_proc' : ['proc', 'Other process memory'],
- 'code' : ['system', 'Code'],
- 'atom' : ['system', 'Atoms'],
- 'other_system' : ['system', 'Other system'],
- 'allocated_unused' : ['unused', 'Allocated unused'],
- 'reserved_unallocated': ['unused', 'Unallocated reserved by the OS']};
-%>
-<%= format('memory-bar', {sections: sections, memory: memory, total_out: []}) %>
+<%= format('memory-bar', {sections: MEMORY_STATISTICS.sections, memory: memory, total_out: []}) %>
-<%
-var key = [[{name: 'Classic Queues', colour: 'classic',
- keys: [['queue_procs', 'queues']]},
- {name: 'Quorum Queues', colour: 'quorum',
- keys: [['quorum_queue_procs','quorum'],
- ['quorum_queue_dlx_procs', 'dead letter workers']]},
- {name: 'Streams', colour: 'stream',
- keys: [['stream_queue_procs', 'stream'],
- ['stream_queue_replica_reader_procs', 'stream replica reader'],
- ['stream_queue_coordinator_procs', 'stream coordinator']]},
- {name: 'Binaries', colour: 'binary',
- keys: [['binary', '']]}],
-
- [{name: 'Connections', colour: 'conn',
- keys: [['connection_readers', 'readers'],
- ['connection_writers', 'writers'],
- ['connection_channels', 'channels'],
- ['connection_other', 'other']]}],
-
- [{name: 'Tables', colour: 'table',
- keys: [['mnesia', 'internal database tables'],
- ['msg_index', 'message store index'],
- ['mgmt_db', 'management database'],
- ['quorum_ets', 'quorum queue tables'],
- ['other_ets', 'other']]}],
-
- [{name: 'Processes', colour: 'proc',
- keys: [['plugins', 'plugins'],
- ['metadata_store', 'metadata store'],
- ['other_proc', 'other']]},
- {name: 'System', colour: 'system',
- keys: [['code', 'code'],
- ['atom', 'atoms'],
- ['other_system', 'other']
- ]}],
-
- [{name: 'Preallocated memory', colour: 'unused',
- keys: [['allocated_unused', 'preallocated by runtime, unused'],
- ['reserved_unallocated', 'unallocated, reserved by the OS']]}]];
-%>
-<%= format('memory-table', {key: key, memory: memory}) %>
+<%= format('memory-table', {key: MEMORY_STATISTICS.keys, memory: memory}) %>
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/policies.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/policies.ejs
index 54ee48189620..67dd8594987d 100644
--- a/deps/rabbitmq_management/priv/www/js/tmpl/policies.ejs
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/policies.ejs
@@ -83,9 +83,11 @@
Exchanges and queues
Exchanges
Queues
-
Classic Queues
-
Quorum Queues
-
Streams
+ <% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
+ <% if (typename != "default") { %>
+
<%= type_config.label %> Queues
+ <% } %>
+ <% } %>
@@ -111,15 +113,11 @@
Consumer Timeout |
Leader locator
-
- Queues [Quorum]
-
- Delivery limit
- |
- Dead letter strategy
- |
-
-
+ <% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
+ <% if (typename != "default") { %>
+ <%= format(type_config.tmpl.user_policy_arguments, {}) %>
+ <% } %>
+ <% } %>
Streams
@@ -246,9 +244,11 @@
Queues
- Classic Queues
- Quorum Queues
- Streams
+ <% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
+ <% if (typename != "default") { %>
+ <%= type_config.label %> Queues
+ <% } %>
+ <% } %>
@@ -261,39 +261,11 @@
-
- Queues [Classic]
-
- Auto expire |
- Max length |
- Max length bytes |
- Message TTL |
- |
- Length limit overflow behaviour
-
-
-
- Queues [Quorum]
-
- Delivery limit
- |
- Auto expire |
- Max in-memory bytes |
- Max in-memory length
- Max length |
- Max length bytes |
- Message TTL
- |
- Target group size |
- Length limit overflow behaviour
-
-
-
- Queues [Streams]
-
- Max length bytes
-
-
+ <% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
+ <% if (typename != "default") { %>
+ <%= format(type_config.tmpl.operator_policy_arguments, {}) %>
+ <% } %>
+ <% } %>
*
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs
index c4bed04b9c9b..a8ddcd81e661 100644
--- a/deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/queue.ejs
@@ -37,212 +37,12 @@
<% } %>
<% if (nodes_interesting) { %>
-
- <% if (is_quorum(queue) || is_stream(queue)) { %>
- Leader
- <% } else { %>
- Node
- <% } %>
- <% if (queue.leader) { %>
- <%= fmt_node(queue.leader) %>
- <% } else { %>
- <%= fmt_node(queue.node) %>
- <% } %>
-
- <% if (is_quorum(queue) || is_stream(queue)) { %>
-
- Online
-
- <%
- for (var i in queue.online) {
- %>
- <%= fmt_node(queue.online[i]) %>
-
- <% } %>
-
-
-
Members
-
- <%
- for (var i in queue.members) {
- %>
- <%= fmt_node(queue.members[i]) %>
-
- <% } %>
-
-
- <% } %>
+ <%= format(QUEUE_TYPE(queue).tmpl.node_details, {queue: queue}) %>
<% } %>
-<% if(!disable_stats) { %>
-
-
- State
- <%= fmt_object_state(queue) %>
-
- <% if(queue.consumers) { %>
-
- Consumers
- <%= fmt_string(queue.consumers) %>
-
- <% } else if(queue.hasOwnProperty('consumer_details')) { %>
-
- Consumers
- <%= fmt_string(queue.consumer_details.length) %>
-
- <% } %>
- <% if (is_classic(queue)) { %>
-
- Consumer capacity
- <%= fmt_percent(queue.consumer_capacity) %>
-
- <% } %>
- <% if(queue.hasOwnProperty('publishers')) { %>
-
- Publishers
- <%= fmt_string(queue.publishers) %>
-
- <% } %>
- <% if (is_quorum(queue)) { %>
-
- Open files
- <%= fmt_table_short(queue.open_files) %>
-
- <% if (queue.hasOwnProperty('delivery_limit')) { %>
-
- Delivery limit
- <%= fmt_string(queue.delivery_limit) %>
-
- <% } %>
- <% } %>
- <% if (is_stream(queue)) { %>
-
- Readers
- <%= fmt_table_short(queue.readers) %>
-
-
- Segments
- <%= fmt_string(queue.segments) %>
-
- <% } %>
-
-
-
-
-
- Total
- <% if (!is_stream(queue)) { %>
- Ready
- Unacked
- <% } %>
- <% if (is_quorum(queue)) { %>
- High priority
- Normal priority
- Returned
- Dead-lettered
-
-
- <% } %>
- <% if (is_classic(queue)) { %>
- In memory
- Persistent
- Transient
- <% } %>
-
-
-
- Messages
- <% if (is_stream(queue)) { %>
-
- <% } else { %>
-
- <% } %>
-
-
- <%= fmt_num_thousands(queue.messages) %>
-
- <% if (!is_stream(queue)) { %>
-
- <%= fmt_num_thousands(queue.messages_ready) %>
-
-
- <%= fmt_num_thousands(queue.messages_unacknowledged) %>
-
- <% } %>
- <% if (is_quorum(queue)) { %>
-
- <%= fmt_num_thousands(queue.messages_ready_high) %>
-
-
- <%= fmt_num_thousands(queue.messages_ready_normal) %>
-
-
- <%= fmt_num_thousands(queue.messages_ready_returned) %>
-
-
- <%= fmt_num_thousands(queue.messages_dlx) %>
-
- <% } %>
- <% if (is_classic(queue)) { %>
-
- <%= fmt_num_thousands(queue.messages_ram) %>
-
-
- <%= fmt_num_thousands(queue.messages_persistent) %>
-
-
- <%= fmt_num_thousands(queue.messages_paged_out) %>
-
- <% } %>
-
-
- <% if (is_classic(queue) || is_quorum(queue)) { %>
-
- Message body bytes
-
-
-
- <%= fmt_bytes(queue.message_bytes) %>
-
-
- <%= fmt_bytes(queue.message_bytes_ready) %>
-
-
- <%= fmt_bytes(queue.message_bytes_unacknowledged) %>
-
- <% } %>
- <% if (is_quorum(queue)) { %>
-
-
-
-
-
-
-
- <%= fmt_bytes(queue.message_bytes_dlx) %>
-
- <% } %>
- <% if (is_classic(queue)) { %>
-
- <%= fmt_bytes(queue.message_bytes_ram) %>
-
-
- <%= fmt_bytes(queue.message_bytes_persistent) %>
-
-
- <%= fmt_bytes(queue.message_bytes_paged_out) %>
-
- <% } %>
-
-
-
- Process memory
-
-
- <%= fmt_bytes(queue.memory) %>
-
-
+ <% if(!disable_stats) { %>
+ <%= format(QUEUE_TYPE(queue).tmpl.stats, {queue: queue}) %>
<% } %>
@@ -300,7 +100,7 @@
<%= format('publish', {'mode': 'queue', 'queue': queue}) %>
-<% if (!is_stream(queue)) { %>
+<% if (QUEUE_TYPE(queue).actions.get_message) { %>
Get messages
@@ -395,6 +195,7 @@
<% } %>
+<% if (!is_internal(queue)) { %>
Delete
@@ -406,8 +207,9 @@
+<% } %>
-<% if (!is_stream(queue)) { %>
+<% if (QUEUE_TYPE(queue).actions.purge) { %>
Purge
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/queues.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/queues.ejs
index 8d2201295fcb..d1e9d8bca321 100644
--- a/deps/rabbitmq_management/priv/www/js/tmpl/queues.ejs
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/queues.ejs
@@ -245,22 +245,16 @@
Type:
- Default for virtual host
- <% if (queue_type == "classic") { %>
- Classic
- <% } else { %>
- Classic
- <% } %>
- <% if (queue_type == "quorum") { %>
- Quorum
- <% } else { %>
- Quorum
- <% } %>
- <% if (queue_type == "stream") { %>
- Stream
- <% } else { %>
- Stream
- <% } %>
+ Default for virtual host
+ <% for (const [typename, type_config] of Object.entries(QUEUE_TYPE)) { %>
+ <% if (typename != "default") { %>
+ <% if (queue_type == typename) { %>
+ <%= type_config["label"]%>
+ <% } else { %>
+ <%= type_config["label"]%>
+ <% } %>
+ <% } %>
+ <% } %>
@@ -313,32 +307,7 @@
Add
- <% if (queue_type != "stream") { %>
- Auto expire |
- Message TTL |
- Overflow behaviour
- Single active consumer |
- Dead letter exchange |
- Dead letter routing key
- Max length |
- <% } %>
- Max length bytes
- <% if (queue_type == "classic") { %>
- | Maximum priority
- <% } %>
- <% if (queue_type == "quorum") { %>
- | Delivery limit
- | Initial cluster size
- Target cluster size
- | Dead letter strategy
- <% } %>
- <% if (queue_type == "stream") { %>
- | Max time retention
- | Max segment size in bytes
- Filter size (per chunk) in bytes
- | Initial cluster size
- <% } %>
- | Leader locator
+ <%= format(QUEUE_TYPE[queue_type].tmpl['arguments'], {}) %>
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-arguments.ejs
new file mode 100644
index 000000000000..d1a7282e227a
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-arguments.ejs
@@ -0,0 +1,13 @@
+
Auto expire |
+
Message TTL |
+
Overflow behaviour
+
Single active consumer |
+
Dead letter exchange |
+
Dead letter routing key
+
Max length |
+
Max length bytes
+|
Delivery limit
+|
Initial cluster size
+
Target cluster size
+ |
Dead letter strategy
+|
Leader locator
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-node-details.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-node-details.ejs
new file mode 100644
index 000000000000..a25e6d7a3ad9
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-node-details.ejs
@@ -0,0 +1,21 @@
+
+ Leader
+ <%= fmt_node(queue.leader) %>
+
+
+ Online
+
+ <% for (var i in queue.online) { %>
+ <%= fmt_node(queue.online[i]) %>
+
+ <% } %>
+
+
+
Members
+
+ <% for (var i in queue.members) { %>
+ <%= fmt_node(queue.members[i]) %>
+
+ <% } %>
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-operator-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-operator-policy-arguments.ejs
new file mode 100644
index 000000000000..4e13f8ea94d0
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-operator-policy-arguments.ejs
@@ -0,0 +1,16 @@
+
+ Queues [Quorum]
+
+ Delivery limit
+ |
+ Auto expire |
+ Max in-memory bytes |
+ Max in-memory length
+ Max length |
+ Max length bytes |
+ Message TTL
+ |
+ Target group size |
+ Length limit overflow behaviour
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-stats.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-stats.ejs
new file mode 100644
index 000000000000..15191860c300
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-stats.ejs
@@ -0,0 +1,106 @@
+
+
+ State
+ <%= fmt_object_state(queue) %>
+
+ <% if(queue.consumers) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumers) %>
+
+ <% } else if(queue.hasOwnProperty('consumer_details')) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumer_details.length) %>
+
+ <% } %>
+ <% if(queue.hasOwnProperty('publishers')) { %>
+
+ Publishers
+ <%= fmt_string(queue.publishers) %>
+
+ <% } %>
+
+ Open files
+ <%= fmt_table_short(queue.open_files) %>
+
+ <% if (queue.hasOwnProperty('delivery_limit')) { %>
+
+ Delivery limit
+ <%= fmt_string(queue.delivery_limit) %>
+
+ <% } %>
+
+
+
+
+
+ Total
+ Ready
+ Unacked
+ High priority
+ Normal priority
+ Returned
+ Dead-lettered
+
+
+
+
+
+ Messages
+
+
+
+ <%= fmt_num_thousands(queue.messages) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ready) %>
+
+
+ <%= fmt_num_thousands(queue.messages_unacknowledged) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ready_high) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ready_normal) %>
+
+
+ <%= fmt_num_thousands(queue.messages_ready_returned) %>
+
+
+ <%= fmt_num_thousands(queue.messages_dlx) %>
+
+
+
+
+ Message body bytes
+
+
+
+ <%= fmt_bytes(queue.message_bytes) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_ready) %>
+
+
+ <%= fmt_bytes(queue.message_bytes_unacknowledged) %>
+
+
+
+
+
+
+
+
+ <%= fmt_bytes(queue.message_bytes_dlx) %>
+
+
+
+
+ Process memory
+
+
+ <%= fmt_bytes(queue.memory) %>
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-user-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-user-policy-arguments.ejs
new file mode 100644
index 000000000000..2a29a627ed8f
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-user-policy-arguments.ejs
@@ -0,0 +1,9 @@
+
+ Queues [Quorum]
+
+ Delivery limit
+ |
+ Dead letter strategy
+ |
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-arguments.ejs
new file mode 100644
index 000000000000..1bc197b328d8
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-arguments.ejs
@@ -0,0 +1,6 @@
+
Max length bytes
+|
Max time retention
+|
Max segment size in bytes
+
Filter size (per chunk) in bytes
+|
Initial cluster size
+|
Leader locator
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-node-details.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-node-details.ejs
new file mode 100644
index 000000000000..a25e6d7a3ad9
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-node-details.ejs
@@ -0,0 +1,21 @@
+
+ Leader
+ <%= fmt_node(queue.leader) %>
+
+
+ Online
+
+ <% for (var i in queue.online) { %>
+ <%= fmt_node(queue.online[i]) %>
+
+ <% } %>
+
+
+
Members
+
+ <% for (var i in queue.members) { %>
+ <%= fmt_node(queue.members[i]) %>
+
+ <% } %>
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-operator-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-operator-policy-arguments.ejs
new file mode 100644
index 000000000000..01039ed7b110
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-operator-policy-arguments.ejs
@@ -0,0 +1,6 @@
+
+ Queues [Streams]
+
+ Max length bytes
+
+
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-stats.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-stats.ejs
new file mode 100644
index 000000000000..aca685bc3055
--- /dev/null
+++ b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-stats.ejs
@@ -0,0 +1,56 @@
+
+
+ State
+ <%= fmt_object_state(queue) %>
+
+ <% if(queue.consumers) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumers) %>
+
+ <% } else if(queue.hasOwnProperty('consumer_details')) { %>
+
+ Consumers
+ <%= fmt_string(queue.consumer_details.length) %>
+
+ <% } %>
+ <% if(queue.hasOwnProperty('publishers')) { %>
+
+ Publishers
+ <%= fmt_string(queue.publishers) %>
+
+ <% } %>
+
+ Readers
+ <%= fmt_table_short(queue.readers) %>
+
+
+ Segments
+ <%= fmt_string(queue.segments) %>
+
+
+
+
+
+
+ Total
+
+
+
+ Messages
+
+
+
+ <%= fmt_num_thousands(queue.messages) %>
+
+
+
+
+
+
+ Process memory
+
+
+ <%= fmt_bytes(queue.memory) %>
+
+
\ No newline at end of file
diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-user-policy-arguments.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/stream-queue-user-policy-arguments.ejs
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/deps/rabbitmq_management/src/rabbit_mgmt_wm_queue.erl b/deps/rabbitmq_management/src/rabbit_mgmt_wm_queue.erl
index addef565358c..9a0f406a5cb0 100644
--- a/deps/rabbitmq_management/src/rabbit_mgmt_wm_queue.erl
+++ b/deps/rabbitmq_management/src/rabbit_mgmt_wm_queue.erl
@@ -128,11 +128,14 @@ queue_with_totals(ReqData) ->
queue_with_totals(VHost, QName) ->
Name = rabbit_misc:r(VHost, queue, QName),
+ %% this somehow shares fields with mgmt_format:queue :-/
case rabbit_amqqueue:lookup(Name) of
- {ok, Q} -> QueueInfo = rabbit_amqqueue:info(Q,
+ {ok, Q} -> QueueInfo0 = rabbit_amqqueue:info(Q,
[name, durable, auto_delete, exclusive,
owner_pid, arguments, type, state,
policy, totals, online, type_specific]),
- rabbit_mgmt_format:queue_info(QueueInfo);
+ QueueInfo1 = QueueInfo0 ++ [{internal, amqqueue:is_internal(Q)},
+ {internal_owner, rabbit_mgmt_format:internal_owner(amqqueue:internal_owner(Q))}],
+ rabbit_mgmt_format:queue_info(QueueInfo1);
{error, not_found} -> not_found
end.
diff --git a/deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl b/deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl
index b4e444e7d3ff..0f3956684344 100644
--- a/deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl
+++ b/deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl
@@ -10,7 +10,7 @@
-export([format/2, ip/1, ipb/1, amqp_table/1, tuple/1]).
-export([parameter/1, now_to_str/0, now_to_str/1, strip_pids/1]).
-export([protocol/1, resource/1, queue/1, queue/2, queue_state/1, queue_info/1]).
--export([exchange/1, user/1, internal_user/1, binding/1, url/2]).
+-export([exchange/1, user/1, internal_user/1, binding/1, url/2, internal_owner/1]).
-export([pack_binding_props/2, tokenise/1]).
-export([to_amqp_table/1, listener/1, web_context/1, properties/1, basic_properties/1]).
-export([record/2, to_basic_properties/1]).
@@ -401,10 +401,19 @@ queue(Q, Ctx) when ?is_amqqueue(Q) ->
{exclusive, is_pid(ExclusiveOwner)},
{owner_pid, ExclusiveOwner},
{arguments, amqp_table(Arguments)},
- {pid, Pid}
+ {pid, Pid},
+ {internal, amqqueue:is_internal(Q)},
+ {internal_owner, internal_owner(amqqueue:internal_owner(Q))}
%% type specific stuff like, state, type, members etc is returned here
| rabbit_queue_type:format(Q, Ctx)].
+internal_owner(undefined) ->
+ false;
+internal_owner(#resource{} = Owner) ->
+ [{name, Owner#resource.name},
+ {kind, Owner#resource.kind},
+ {vhost, Owner#resource.virtual_host}].
+
queue_info(List) ->
format(List, {fun format_exchange_and_queue/1, false}).