PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 19, 2022

[FIXED] How does COUNT work with multiple streams in XREADGROUP?

 September 19, 2022     consumer, redis, redis-streams     No comments   

Issue

I want to use the Redis XREADGROUP command to consume messages from multiple Redis streams. What does the COUNT parameter mean in such cases (i.e. is it the total number of messages, or a number of messages per stream)? Also, is it possible to read exactly one message with this scenario?


Solution

COUNT is the maximum number of elements per stream. The XREADGROUP command is a special version of the XREAD command with support for consumer groups. So the documentation for XREAD applies.

You can set COUNT as 1, then you'll get up to 1 element per stream in the command.

If you don't set COUNT, you get all messages available per stream.



Answered By - LeoMurillo
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing