Skip to content

XClaim does not work as expected #2514

@piavgh

Description

@piavgh

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

EDIT: this is not a bug but an expected behavior of Redis Stream
Related issues:


Expected Behavior

The XClaim method should return the list of claimed messages (XMessages) (as specified in the document https://redis.io/commands/xclaim/ Return section), and err = nil in case of success event

Current Behavior

  • It claim the messages successfully (I checked RedisInsight and I see that the messages were claimed)
    image

  • The returned XMessages is nil, while the err = redis: nil
    image

Possible Solution

Steps to Reproduce

xMessages, err := s.client.XClaim(ctx, &redis.XClaimArgs{
		Stream:  "stream-name",
		Group:    "consumer-group-name",
		Consumer: "consumer-name",
		MinIdle:  30 * time.Second,
		Messages: <list of messages>,
	}).Result()
	if err != nil {
		return nil, err // <= it will run into this section
	}
 
        ...

Context (Environment)

I'm trying to use XPendingExt and XClaim to set up a workflow that if one consumer dies unexpectedly, another consumer can take the unprocessed messages and continue to process them (so that no messages are loss without being processed)

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