Skip to content

Commit 285557c

Browse files
authored
D1054456: Construct an invalid queue name if required (#239)
1 parent c4a976d commit 285557c

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

release-notes-10.0.1.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
!not-ready-for-release!
2-
31
#### Version Number
42
${version-number}
53

64
#### New Features
5+
- None
6+
7+
#### Bug Fixes
8+
- **D1054456:** Corrected invalid queue configuration to be optional
9+
Workers do not have to supply an invalid task queue.
710

811
#### Known Issues
12+
- None

worker-queue-rabbit/src/main/java/com/github/workerframework/queues/rabbit/RabbitWorkerQueue.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,27 @@ public RabbitWorkerQueue(
9999
{
100100
this.config = Objects.requireNonNull(config);
101101
this.maxTasks = maxTasks;
102-
this.invalidQueue = Objects.requireNonNull(invalidQueue);
102+
this.invalidQueue = getInvalidQueueName(config, invalidQueue);
103103
this.dataStore = Objects.requireNonNull(dataStore);
104104
this.codec = Objects.requireNonNull(codec);
105105
LOG.debug("Initialised");
106106
}
107107

108+
private static String getInvalidQueueName(final RabbitWorkerQueueConfiguration config, final String invalidQueue)
109+
{
110+
if (invalidQueue != null) {
111+
return invalidQueue;
112+
}
113+
114+
final String inputQueue = config.getInputQueue();
115+
116+
final String invalidQueuePrefix = inputQueue.endsWith("-in")
117+
? inputQueue.substring(0, inputQueue.length() - 3)
118+
: inputQueue;
119+
120+
return invalidQueuePrefix + "-invalid";
121+
}
122+
108123
/**
109124
* {@inheritDoc}
110125
*

0 commit comments

Comments
 (0)