Skip to content

api XReadGroup  #3194

Closed
Closed
@ajchen-88

Description

@ajchen-88

Issue tracker is used for reporting bugs and discussing new features. Please use
stackoverflow for supporting issues.

use XReadGroup read msg from stream:

			entries, err := client.XReadGroup(ctx1, &redis.XReadGroupArgs{
				Group:    group,
				Consumer: consumer,
				Streams:  []string{streamName, ">"},
				//Streams: []string{"mystream"},
				Count: 10,
				Block: 5000, //  Block for 5000 milliseconds
			}).Result()

Expected Behavior

Use XReadGroup to read messages from the specified consumer group, setting the Block parameter to 5000 milliseconds.
If no new messages are available, the program will return after 5 seconds and continue the loop.

Current Behavior

if we set Block: 5000 the api is block and not return ,until the new message come

Possible Solution

Steps to Reproduce

			entries, err := client.XReadGroup(ctx1, &redis.XReadGroupArgs{
				Group:    group,
				Consumer: consumer,
				Streams:  []string{streamName, ">"},
				//Streams: []string{"mystream"},
				Count: 10,
				Block: 5000, //  Block for 5000 milliseconds
			}).Result()

Context (Environment)

Detailed Description

Possible Implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions