8000 Fix default rabbit timestamp by dmder · Pull Request #2226 · ag2ai/faststream · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix default rabbit timestamp #2226

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

Merged
merged 5 commits into from
May 21, 2025
Merged

Conversation

dmder
Copy link
Contributor
@dmder dmder commented May 20, 2025

Description

The docstring for RabbitBroker suggests that timestamp: Message publish timestamp. Generated automatically if not present., however in fact it is not since aio_pika.message.encode_timestamp doesn't do anything with Nones.

Fixing this annoyance here.

Fixes #2225

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (scripts/lint.sh shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running scripts/test-cov.sh
  • I have ensured that static analysis tests are passing by running scripts/static-analysis.sh
  • I have included code examples to illustrate the modifications

@CLAassistant
Copy link
CLAassistant commented May 20, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator
@Lancetnik Lancetnik left a comment

Choose a reason for hiding this comment

T 8000 he reason will be displayed to describe this comment to others. Learn more.

I don't think, that we should impl this logic everywhere
Please, move it to producer._publish method – https://github.com/ag2ai/faststream/blob/main/faststream/rabbit/publisher/producer.py#L224

@Lancetnik Lancetnik added bug Something isn't working RabbitMQ Issues related to `faststream.rabbit` module and RabbitMQ broker features labels May 20, 2025
@dmder
Copy link
Contributor Author
dmder commented May 20, 2025

I don't think, that we should impl this logic everywhere Please, move it to producer._publish method – https://github.com/ag2ai/faststream/blob/main/faststream/rabbit/publisher/producer.py#L224

done

@Lancetnik
Copy link
Collaborator

Great, thank you!

@Lancetnik Lancetnik enabled auto-merge May 21, 2025 04:51
@Lancetnik Lancetnik added this pull request to the merge queue May 21, 2025
Merged via the queue into ag2ai:main with commit 4163896 May 21, 2025
33 checks passed
@dmder dmder deleted the fix-rabbit-timestamp branch May 21, 2025 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working RabbitMQ Issues related to `faststream.rabbit` module and RabbitMQ broker features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Timestamp is not set automatically when publishing a new RabbitMQ message
3 participants
0