chibenwa commented on code in PR #3230:
URL: https://github.com/apache/james-project/pull/3230#discussion_r4192316658


##########
pom.xml:
##########
@@ -4603,16 +4603,5 @@
                 </pluginManagement>
             </build>
         </profile>
-        <profile>
-            <id>windows-git</id>
-            <activation>
-                <os>
-                    <family>windows</family>
-                </os>
-            </activation>
-            <properties>
-                <git.useNativeGit>false</git.useNativeGit>
-            </properties>
-        </profile>

Review Comment:
   Oups ?



##########
server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQConfiguration.java:
##########
@@ -47,10 +47,10 @@ public class ActiveMQConfiguration {
     private static final boolean ASYNC_CONNECTION_EXECUTION_DEFAULT = true;
 
     private static final String CLIENT_BLOCK_ON_DURABLE_SEND = 
"artemis.client.block.on.durable.send";
-    private static final boolean CLIENT_BLOCK_ON_DURABLE_SEND_DEFAULT = true;
+    private static final boolean CLIENT_BLOCK_ON_DURABLE_SEND_DEFAULT = false;
 
     private static final String CLIENT_BLOCK_ON_ACKNOWLEDGE = 
"artemis.client.block.on.acknowledge";
-    private static final boolean CLIENT_BLOCK_ON_ACKNOWLEDGE_DEFAULT = true;
+    private static final boolean CLIENT_BLOCK_ON_ACKNOWLEDGE_DEFAULT = false;

Review Comment:
   Wekeans durability !



##########
server/queue/queue-activemq/src/test/java/org/apache/james/queue/activemq/ActiveMQMailQueueTest.java:
##########
@@ -144,4 +143,133 @@ public void delayedEmailsShouldBeDeleted() {
     public void delayedEmailsShouldBeDeletedWhenMixedWithOtherEmails() {
 
     }
+
+    @Test
+    void delayedMessagesShouldNotBlockReadyMessagesHolBlocking() throws 
Exception {
+        // Enqueue a burst of delayed messages
+        for (int i = 0; i < 50; i++) {
+            mailQueue.enQueue(org.apache.james.queue.api.Mails.defaultMail()
+                .name("delayed-" + i)
+                .build(),
+                1,
+                java.util.concurrent.TimeUnit.HOURS);
+        }
+
+        // Enqueue an immediate (ready) message behind the delayed ones
+        mailQueue.enQueue(org.apache.james.queue.api.Mails.defaultMail()
+            .name("ready-message")
+            .build());
+
+        // Dequeue should instantly receive the ready message without 
head-of-line blocking
+        
reactor.core.publisher.Mono<org.apache.james.queue.api.MailQueue.MailQueueItem> 
itemMono =
+            reactor.core.publisher.Flux.from(mailQueue.deQueue()).next();
+        org.apache.james.queue.api.MailQueue.MailQueueItem dequeuedItem =

Review Comment:
   Use imports



##########
server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSCacheableMailQueue.java:
##########
@@ -548,7 +548,7 @@ private Stream<Attribute> mailAttribute(Message message, 
String name) {
             if (attrValue == null) {
                 attrValue = message.getObjectProperty(name);
             }
-        } catch (Exception e) {
+        } catch (JMSException e) {

Review Comment:
   Why ?
   
   catch (Exception) → catch (JMSException) in mailAttribute narrows the catch. 
A runtime exception (deserialization, for example) will now propagate instead 
of being logged, which can break dequeueing



##########
server/queue/queue-jms/pom.xml:
##########
@@ -97,11 +97,11 @@
             <artifactId>jakarta.inject-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.artemis</groupId>
+            <groupId>org.apache.activemq</groupId>
             <artifactId>artemis-jakarta-client</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.artemis</groupId>
+            <groupId>org.apache.activemq</groupId>

Review Comment:
   Oups ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to