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

Use annotation-driven configuration for Redis listener endpoints [DATAREDIS-428] #1004

Open
spring-projects-issues opened this issue Aug 31, 2015 · 0 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Aug 31, 2015

Greg Turnquist opened DATAREDIS-428 and commented

Listener configuration in Spring Data Redis requires always to define a MessageListener because Spring Data Redis has no built-in support for an annotation-driven configuration like it is handled JMS or AMQP. Users have to obtain/configure the RedisMessageListenerContainer and to register their own MessageListener. MessageListenerAdapter leverages the requirement for a fixed method signature by allowing to pass a delegate to handle the message event but the infrastructure setup of the listener container is still necessary. Using the MessageListener itself puts a high burden on the developer to consume events because everything is in byte[]'s. Allowing to configure a listener endpoint like it is done with JMS would lighten the load on developers. A possible improvement could look like:

 
public class MyListenerClass {

    @RedisListener(id = "patternEndpoint", pattern = {"/topic/*", "__keyevent@*__:expired"})
    void handleOnPattern(String pattern, Message message) {
         // ...
    }

    @RedisListener(channel = "/channels/channel1")
    void handleOnChannel(String channel, Message message) {
        // ...
    }

}

Issue Links:

  • DATAREDIS-1026 Annotation-driven activation of RedisListeners for Pub/Sub
    ("is duplicated by")
  • DATAREDIS-397 Investigate creating @RedisListener for messaging
    ("supersedes")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants