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

Is absolute_expiry_time in milliseconds? #403

Closed
vishnureddy17 opened this issue Mar 28, 2023 · 7 comments
Closed

Is absolute_expiry_time in milliseconds? #403

vishnureddy17 opened this issue Mar 28, 2023 · 7 comments

Comments

@vishnureddy17
Copy link

vishnureddy17 commented Mar 28, 2023

Hello, I am using rhea version 1.0.24.

For the absolute_expiry_time message property, should we be setting to milliseconds since epoch? Apologies if this is supposed to be obvious—I am not able to find an answer looking though the repo. Thanks!

@vishnureddy17 vishnureddy17 changed the title Is absolute_expiry_time in milliseconds? Is absolute_expiry_time in milliseconds? Mar 28, 2023
@grs
Copy link
Member

grs commented Mar 29, 2023

Yes, though you can set it to a javascript Date object.

@vishnureddy17
Copy link
Author

great, thank you! closing this issue for now, but I do think it'd be useful to specify that somewhere such as in the typescript comment. At least for now, someone can search github issues for this answer.

@vishnureddy17
Copy link
Author

vishnureddy17 commented Mar 29, 2023

Also, is setting it to a JavaScript date object supported in 1.0.24? The typescript for that version says number for absolute_expiry_time. Reopening for this outstanding question.

@vishnureddy17 vishnureddy17 reopened this Mar 29, 2023
@grs
Copy link
Member

grs commented Mar 29, 2023

I believe so as the tests use the typescript interface: e.g. https://github.com/amqp/rhea/blob/main/test/messages.ts#L247

@vishnureddy17
Copy link
Author

From my understanding of the commit history, it seems like the corresponding test for 1.0.24 do not use a JavaScript Date object.

Here is a link to the test at the commit where the package.json version was bumped to 1.0.24:
https://github.com/amqp/rhea/blob/2cbe55795b86a43375111f2f446089f55b948ecf/test/messages.ts

Could you clarify what the implication of this is in terms of Date object support on this specific version (1.0.24)? I just want to make sure we are using rhea correctly in production.

Thanks again!

@grs
Copy link
Member

grs commented Mar 29, 2023

Yes, you are correct that support for setting it as a Date object is not available on 1.0.2, where you must set it as the millisecs from epoch (i.e. the value returned by getTime() on the date object).

@vishnureddy17
Copy link
Author

Great, thank you!

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

No branches or pull requests

2 participants