Skip to content

Commit eab7851

Browse files
committed
Added queue statistics for retry and failures
1 parent 459611f commit eab7851

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Maven:
1515
<dependency>
1616
<groupId>de.digitalcollections.flusswerk</groupId>
1717
<artifactId>dc-flusswerk-engine</artifactId>
18-
<version>2.0.0</version>
18+
<version>2.0.1</version>
1919
</dependency>
2020
```
2121

2222
Gradle:
2323

2424
```groovy
2525
dependencies {
26-
compile group: 'de.digitalcollections.flusswerk', name: 'dc-flusswerk-engine', version: '2.0.0'
26+
compile group: 'de.digitalcollections.flusswerk', name: 'dc-flusswerk-engine', version: '2.0.1'
2727
}
2828
```
2929

bdd/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>dc-flusswerk-parent</artifactId>
55
<groupId>de.digitalcollections.flusswerk</groupId>
6-
<version>2.0.1-SNAPSHOT</version>
6+
<version>2.0.1</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99

engine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>de.digitalcollections.flusswerk</groupId>
66
<artifactId>dc-flusswerk-parent</artifactId>
7-
<version>2.0.1-SNAPSHOT</version>
7+
<version>2.0.1</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

engine/src/main/java/de/digitalcollections/flusswerk/engine/messagebroker/MessageBroker.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,24 @@ public Map<String, Long> getMessageCounts() throws IOException {
197197
return result;
198198
}
199199

200+
public Map<String, Long> getFailedMessageCounts() throws IOException {
201+
Map<String, Long> result = new HashMap<>();
202+
for (String inputQueue : routingConfig.getReadFrom()) {
203+
String queue = routingConfig.getFailurePolicy(inputQueue).getFailedRoutingKey();
204+
result.put(queue, rabbitClient.getMessageCount(queue));
205+
}
206+
return result;
207+
}
208+
209+
public Map<String, Long> getRetryMessageCounts() throws IOException {
210+
Map<String, Long> result = new HashMap<>();
211+
for (String inputQueue : routingConfig.getReadFrom()) {
212+
String queue = routingConfig.getFailurePolicy(inputQueue).getRetryRoutingKey();
213+
result.put(queue, rabbitClient.getMessageCount(queue));
214+
}
215+
return result;
216+
}
217+
200218
public boolean isConnectionOk() {
201219
return rabbitClient.isChannelAvailable() && rabbitClient.isConnectionOk();
202220
}

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>de.digitalcollections.flusswerk</groupId>
77
<artifactId>dc-flusswerk-parent</artifactId>
8-
<version>2.0.1-SNAPSHOT</version>
8+
<version>2.0.1</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>de.digitalcollections.flusswerk</groupId>
66
<artifactId>dc-flusswerk-parent</artifactId>
7-
<version>2.0.1-SNAPSHOT</version>
7+
<version>2.0.1</version>
88
<packaging>pom</packaging>
99

1010
<name>DigitalCollections: Flusswerk</name>

0 commit comments

Comments
 (0)