You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/03/11 11:00:00 UTC

[jira] [Work logged] (ARTEMIS-3711) Support AMQ_SCHEDULED_DELAY for OpenWire clients

     [ https://issues.apache.org/jira/browse/ARTEMIS-3711?focusedWorklogId=740000&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-740000 ]

ASF GitHub Bot logged work on ARTEMIS-3711:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Mar/22 10:59
            Start Date: 11/Mar/22 10:59
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on a change in pull request #3979:
URL: https://github.com/apache/activemq-artemis/pull/3979#discussion_r824570093



##########
File path: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java
##########
@@ -224,6 +225,13 @@ public OpenWireMessageConverter() {
          coreMessage.putStringProperty(AMQ_MSG_ORIG_DESTINATION, origDest.getQualifiedName());
       }
 
+      final Object scheduledDelay = messageSend.getProperties().get(ScheduledMessage.AMQ_SCHEDULED_DELAY);
+      if (scheduledDelay != null && scheduledDelay instanceof Long) {

Review comment:
       The null check is redundant

##########
File path: tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/OpenWireScheduledDelayTest.java
##########
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.tests.integration.openwire;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import java.util.Map;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.ScheduledMessage;
+import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.tests.util.RandomUtil;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class OpenWireScheduledDelayTest extends OpenWireTestBase {
+
+   @Override
+   protected void configureAddressSettings(Map<String, AddressSettings> addressSettingsMap) {
+      addressSettingsMap.put("#", new AddressSettings().setDeadLetterAddress(new SimpleString("ActiveMQ.DLQ")));
+   }
+
+   @Test
+   public void testScheduledDelay() throws Exception {
+      final String QUEUE_NAME = RandomUtil.randomString();
+      final long DELAY = 10000;

Review comment:
       Burning 10 seconds on this one test seems excessive, especially if only allowing 250ms for the actual delivery to occur before failing the test. Is there another better systest that would take less time? Perhaps send multiple messages, e.g one with a very long delay so it isnt actually delivered, then one with a 'short' delay of e.g <=2sec thats enough to verify delivery is not-immediate for that one and do a quick check the long one doesnt arrive, perhaps check its future delivery time via management? Maybe even throw in a message with no delay?




-- 
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: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 740000)
    Remaining Estimate: 0h
            Time Spent: 10m

> Support AMQ_SCHEDULED_DELAY for OpenWire clients
> ------------------------------------------------
>
>                 Key: ARTEMIS-3711
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3711
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Support {{AMQ_SCHEDULED_DELAY}} as described in the [ActiveMQ "Classic" documentation|https://activemq.apache.org/delay-and-schedule-message-delivery]. This will help users migrating to Artemis.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)