[
https://issues.apache.org/jira/browse/JAMES-2295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16540926#comment-16540926
]
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_r201878439
--- Diff:
server/queue/queue-jms/src/test/java/org/apache/james/queue/jms/JMSMailQueueTest.java
---
@@ -49,7 +49,8 @@ public void setUp(BrokerService broker) throws Exception {
RawMailQueueItemDecoratorFactory mailQueueItemDecoratorFactory =
new RawMailQueueItemDecoratorFactory();
NoopMetricFactory metricFactory = new NoopMetricFactory();
String queueName = BrokerExtension.generateRandomQueueName(broker);
- mailQueue = new JMSMailQueue(connectionFactory,
mailQueueItemDecoratorFactory, queueName, metricFactory);
+ ConsumerOptions consumerOptions = name -> name +
"?consumer.prefetchSize=0";
--- End diff --
I'm not fan of the consumer options class:
- I believe we should have a JmsConsumerOptions as well, which would use
the knowledge of the prefetch size. So that we can use a builder here.
- Second, i'm not fan of the generic ConsumerOptions enforcing its use as
url parameter. IMO consumer options should be a basic pojo allowing to read
such data (get...) And should let the queue class configuring the connection.
- I'm not convinced at all we need a generic consumer options class. I'd
just keep the jms & ActiveMQ one. Can I pass consumer options to file
implementation?
> 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]