[
https://issues.apache.org/jira/browse/JAMES-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539609#comment-16539609
]
ASF GitHub Bot commented on JAMES-2295:
---------------------------------------
Github user chibenwa commented on a diff in the pull request:
https://github.com/apache/james-project/pull/127#discussion_r201572902
--- Diff:
server/queue/queue-api/src/main/java/org/apache/james/queue/api/MailQueue.java
---
@@ -128,4 +128,24 @@ public MailQueueException(String msg) {
*/
void done(boolean success) throws MailQueueException;
}
+
+ /**
+ * Provides additional options when creating consumers.
+ */
+ interface ConsumerOptions {
+ /**
+ * The empty consumer options.
+ */
+ static ConsumerOptions empty() {
+ return EmptyConsumerOptions.instance();
+ }
+
+ /**
+ * The queue name with options for performing {@link
MailQueue#deQueue()} operation. The implementation may
+ * return {@code queueName} itself if it does not support any
options.
+ *
+ * @return The queue name maybe with additional options.
+ */
+ String applyForDequeue(String queueName);
--- End diff --
More generally, maybe JMS encodes consumer options as URL parameters, but
we should not leak that in our APIs...
> JMS mailqueue deadlock when a single thread issue several consume
> -----------------------------------------------------------------
>
> Key: JAMES-2295
> URL: https://issues.apache.org/jira/browse/JAMES-2295
> Project: James Server
> Issue Type: Bug
> Components: Queue
> Affects Versions: 3.0.0, master, 3.0.1
> Reporter: Tellier Benoit
> Priority: Major
> Labels: bug
>
> This will lead to a dead lock:
> {code:java}
> MailQueue.MailQueueItem mailQueueItem1 = getMailQueue().deQueue();
> MailQueue.MailQueueItem mailQueueItem2 = getMailQueue().deQueue();
> mailQueueItem1.done(true);
> mailQueueItem2.done(true);
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]