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

Feature Request: Conditional reading for PGMQ #288

Closed
yayahc opened this issue Aug 6, 2024 · 9 comments · Fixed by #322 · May be fixed by #326
Closed

Feature Request: Conditional reading for PGMQ #288

yayahc opened this issue Aug 6, 2024 · 9 comments · Fixed by #322 · May be fixed by #326
Labels

Comments

@yayahc
Copy link
Contributor

yayahc commented Aug 6, 2024

I request an enhancement for the PGMQ extension to support conditional message retrieval. This would allow pulling based on specific attributes directly within the pgmq_read function.

eg: Pull messages with a specific type:
SELECT * FROM pgmq_read('my_queue', 30, 1, '{"type": "A"}');

Thank you for considering this feature request.

@ChuckHend
Copy link
Member

Hello @yayahc. To clarify, do you mean that {"type": "A"} would be part of the message, correct? not introducing a new "type" attribute to each message record. E.g. for example, two messages in queue like below, filter for any messages that have the type key with value equal to A:

 msg_id | read_ct |          enqueued_at          |              vt               |             message             
--------+---------+-------------------------------+-------------------------------+---------------------------------
      1 |       0 | 2024-08-06 13:35:08.771765+00 | 2024-08-06 13:35:08.774281+00 | {"type": "A", "hello": "world"}
      2 |       0 | 2024-08-06 13:35:30.572968+00 | 2024-08-06 13:35:30.574291+00 | {"type": "B", "hello": "earth"}

SELECT * FROM pgmq.read('my_queue', 30, 1, '{"type": "A"}'); would return just msg_id = 1.

I think this would be a great feature. There have been some offline discussions about having a feature like this for pgmq.delete() and pgmq.archive() in addition to pgmq.read().

@theory , I wonder if any of the jsonpath projects might come in useful here.

@ChuckHend ChuckHend added the enhancement New feature or request label Aug 6, 2024
@yayahc
Copy link
Contributor Author

yayahc commented Aug 6, 2024

@ChuckHend exactly, it will be awesome to have this feature

Copy link

algora-pbc bot commented Oct 17, 2024

💎 $300 bounty • Tembo

Steps to solve:

  1. Start working: Comment /attempt #288 with your implementation plan
  2. Submit work: Create a pull request including /claim #288 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to tembo-io/pgmq!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @TomBebb Oct 18, 2024, 6:39:14 PM WIP
🟢 @Neptune650 Oct 19, 2024, 12:58:00 AM #322
🔴 @Abiji-2020 Oct 20, 2024, 6:37:51 AM #326

@TomBebb
Copy link

TomBebb commented Oct 18, 2024

/attempt #288

@Neptune650
Copy link
Contributor

Neptune650 commented Oct 19, 2024

/attempt #288

Algora profile Completed bounties Tech Active attempts Options
@Neptune650 2 bounties from 2 projects
C++, C,
Python & more
Cancel attempt

Copy link

algora-pbc bot commented Oct 19, 2024

💡 @Neptune650 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Copy link

algora-pbc bot commented Oct 20, 2024

💡 @Abiji-2020 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@Abiji-2020
Copy link
Contributor

Abiji-2020 commented Oct 20, 2024

/attempt #288

Algora profile Completed bounties Tech Active attempts Options
@Abiji-2020    1 tembo bounty
+ 1 bounty from 1 project
C++, Java,
TypeScript & more
Cancel attempt

Copy link

algora-pbc bot commented Oct 23, 2024

🎉🎈 @Neptune650 has been awarded $300! 🎈🎊

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