Skip to content

Why doesn’t Spring Data Redis provide annotation-based listeners for Redis Streams and Pub/Sub? #3033

@JiHongKim98

Description

@JiHongKim98

Issue Description

I'm curious why Spring Data Redis doesn’t offer an annotation-based listener mechanism for Redis Streams and Pub/Sub, similar to @KafkaListener in Spring Kafka. My thought is that having an annotation-based approach could make Redis Pub/Sub or Streams easier to use, particularly when using Redis as a messaging broker.

Example Scenario

public class SomeListenerClass {

    @RedisStreamListener(streamKey = "notification-stream")
    public void someHandleStreamMessage(MapRecord<String, String, String> message) {
        // ...
    }

    @RedisPubSubListener(channel = "alert-channel")
    public void someHandlePubSubMessage(String message) {
        // ...
    }
}

Questions

  1. Is there a specific reason why annotation-based listeners are not currently supported for Redis Streams and Pub/Sub?
  2. If not, are there any plans to introduce such functionality in future releases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions