Skip to content

Commit 61bbd5d

Browse files
authored
[#1823] Align DestinationView and DestinationViewMBean (#1824) (#1841)
(cherry picked from commit 5658dc7)
1 parent 422dbf7 commit 61bbd5d

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ public long getStoreMessageSize() {
137137
return messageStore != null ? messageStore.getMessageStoreStatistics().getMessageSize().getTotalSize() : 0;
138138
}
139139

140+
@Override
141+
public long getMessagesCachedCount() {
142+
return destination.getDestinationStatistics().getMessagesCached().getCount();
143+
}
144+
145+
@Deprecated(forRemoval = true) // see: getMessagesCachedCount() instead. This method name is inconsistent
140146
public long getMessagesCached() {
141147
return destination.getDestinationStatistics().getMessagesCached().getCount();
142148
}
@@ -438,10 +444,12 @@ public int getMaxProducersToAudit() {
438444
return destination.getMaxProducersToAudit();
439445
}
440446

447+
@Override
441448
public boolean isEnableAudit() {
442449
return destination.isEnableAudit();
443450
}
444451

452+
@Override
445453
public void setEnableAudit(boolean enableAudit) {
446454
destination.setEnableAudit(enableAudit);
447455
}

activemq-broker/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ public interface DestinationViewMBean {
131131
@MBeanInfo("Number of producers attached to this destination")
132132
long getProducerCount();
133133

134+
135+
/**
136+
* @return the number of messages cached
137+
*/
138+
@MBeanInfo("Number of messages cached")
139+
public long getMessagesCachedCount();
140+
134141
/**
135142
* Returns the number of messages in this destination which are yet to be
136143
* consumed
@@ -263,6 +270,19 @@ public String sendTextMessageWithProperties(@MBeanInfo("properties") String prop
263270
@MBeanInfo("Memory used by undelivered messages in bytes")
264271
long getMemoryUsageByteCount();
265272

273+
/**
274+
* @return the EnableAudit setting for duplicate message checking
275+
*/
276+
@MBeanInfo("Audit is enabled for duplicate message checking")
277+
boolean isEnableAudit();
278+
279+
/**
280+
* set the flag to enable or disable audit for duplicate message checking
281+
* @param enableAudit
282+
* enable/disable audit on the destination
283+
*/
284+
void setEnableAudit(boolean enableAudit);
285+
266286
/**
267287
* @return the amount of memory allocated to this destination
268288
*/

0 commit comments

Comments
 (0)