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

Issue 252: Allow clients to specify message expiration time. #253

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ggallen
Copy link
Collaborator

@ggallen ggallen commented Dec 21, 2022

Allow clients to specify a message time-to-live (in milliseconds) when publishing a messsage.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@ggallen ggallen self-assigned this Dec 21, 2022
Copy link
Contributor

@scoheb scoheb left a comment

Choose a reason for hiding this comment

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

small test comment but otherwise LGTM

@olivergondza
Copy link
Member

Thanks for the merge request!

  • Can you elaborate on the use-case where I, as a user, would want my message to expire before processing?
  • Is the millisecond resolution truly adequate? Given this is not expected to use sub-second (/sub-minute) times, let's use seconds/minutes instead.

@maneeshmehra
Copy link

Can you elaborate on the use-case where I, as a user, would want my message to expire before processing?

@olivergondza: I can try to take a stab at answering your question. Assume a situation where a sender is expecting that a certain message is received and processed in some predetermined time by a known consumer. If the message is not processed in that time by the known consumer, the sender retries and resends another message. The sender continues to send the message until the message is processed by its known consumer. If in situations like these, the default value for message expiration is higher than what the sender is willing to wait for, the queue gets flooded with multiple duplicate messages and ends up inundating the consumer with additional burden of processing duplicate messages. If the code allows the sender to override the expiration time with its own custom value, then it will allow the messaging provider to drop the messages that have expired and reduce the overall processing burden on the consumer.

@ggallen
Copy link
Collaborator Author

ggallen commented Mar 6, 2023

Is the millisecond resolution truly adequate? Given this is not expected to use sub-second (/sub-minute)
times, let's use seconds/minutes instead.

@olivergondza , I changed to minutes in my latest push.

@maneeshmehra
Copy link

Only after reading https://stackoverflow.com/questions/31709353/jms-messageproducer-settimetolive-vs-textmessage-setjmsexpiration did I understand why you chose to set the time-to-live and not the JMSExpiration. Great job with the changes. Looking forward to seeing them get merged soon.

@@ -82,7 +92,8 @@ public CIMessageSenderStep(final String providerName,
final MESSAGE_TYPE messageType,
final String messageProperties,
final String messageContent,
Boolean failOnError) {
Boolean failOnError,
Integer timeToLiveMinutes) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@olivergondza , that change is already in the PR, unless I am missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants