Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-3711 support AMQ_SCHEDULED_DELAY for OpenWire clients #3979

Merged
merged 1 commit into from Mar 21, 2022

Conversation

jbertram
Copy link
Contributor

@jbertram jbertram commented Mar 8, 2022

No description provided.

@jbertram jbertram force-pushed the ARTEMIS-3711 branch 7 times, most recently from 2e1a373 to d4b382b Compare March 9, 2022 17:21
Comment on lines +228 to +234
final Object scheduledDelay = messageSend.getProperties().get(ScheduledMessage.AMQ_SCHEDULED_DELAY);
if (scheduledDelay instanceof Long) {
coreMessage.putLongProperty(org.apache.activemq.artemis.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + ((Long) scheduledDelay));
// this property may have already been copied, but we don't need it anymore
coreMessage.removeProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

      final Object scheduledDelay = messageSend.getProperties().get(ScheduledMessage.AMQ_SCHEDULED_DELAY);
       if (scheduledDelay instanceof Number) {
          coreMessage.putLongProperty(org.apache.activemq.artemis.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + ((Number) scheduledDelay).longValue());
          // this property may have already been copied, but we don't need it anymore
          coreMessage.removeProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY);
       }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about restricting it as long?

What about using Number, and longValue() ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked and the openwire client has a check.. so it's ok

@clebertsuconic clebertsuconic merged commit 3627ba5 into apache:main Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants