@@ -70,8 +70,8 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, rd *proto.R
70
70
break
71
71
}
72
72
73
- // Skip pub/sub messages - they should be handled by the pub/sub system
74
- if isPubSubMessage (notificationName ) {
73
+ // Skip notifications that should be handled by other systems
74
+ if shouldSkipNotification (notificationName ) {
75
75
break
76
76
}
77
77
@@ -91,6 +91,11 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, rd *proto.R
91
91
if len (notification ) > 0 {
92
92
// Extract the notification type (first element)
93
93
if notificationType , ok := notification [0 ].(string ); ok {
94
+ // Skip notifications that should be handled by other systems
95
+ if shouldSkipNotification (notificationType ) {
96
+ continue
97
+ }
98
+
94
99
// Get the handler for this notification type
95
100
if handler := p .registry .GetHandler (notificationType ); handler != nil {
96
101
// Handle the notification
@@ -103,17 +108,42 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, rd *proto.R
103
108
return nil
104
109
}
105
110
106
- // isPubSubMessage checks if a notification type is a pub/sub message that should be ignored
107
- // by the push notification processor and handled by the pub/sub system instead .
108
- func isPubSubMessage (notificationType string ) bool {
111
+ // shouldSkipNotification checks if a notification type should be ignored by the push notification
112
+ // processor and handled by other specialized systems instead ( pub/sub, streams, keyspace, etc.) .
113
+ func shouldSkipNotification (notificationType string ) bool {
109
114
switch notificationType {
115
+ // Pub/Sub notifications - handled by pub/sub system
110
116
case "message" , // Regular pub/sub message
111
117
"pmessage" , // Pattern pub/sub message
112
118
"subscribe" , // Subscription confirmation
113
119
"unsubscribe" , // Unsubscription confirmation
114
120
"psubscribe" , // Pattern subscription confirmation
115
121
"punsubscribe" , // Pattern unsubscription confirmation
116
- "smessage" : // Sharded pub/sub message (Redis 7.0+)
122
+ "smessage" , // Sharded pub/sub message (Redis 7.0+)
123
+ "ssubscribe" , // Sharded subscription confirmation
124
+ "sunsubscribe" , // Sharded unsubscription confirmation
125
+
126
+ // Stream notifications - handled by stream consumers
127
+ "xread-from" , // Stream reading notifications
128
+ "xreadgroup-from" , // Stream consumer group notifications
129
+
130
+ // Client tracking notifications - handled by client tracking system
131
+ "invalidate" , // Client-side caching invalidation
132
+
133
+ // Keyspace notifications - handled by keyspace notification subscribers
134
+ // Note: Keyspace notifications typically have prefixes like "__keyspace@0__:" or "__keyevent@0__:"
135
+ // but we'll handle the base notification types here
136
+ "expired" , // Key expiration events
137
+ "evicted" , // Key eviction events
138
+ "set" , // Key set events
139
+ "del" , // Key deletion events
140
+ "rename" , // Key rename events
141
+ "move" , // Key move events
142
+ "copy" , // Key copy events
143
+ "restore" , // Key restore events
144
+ "sort" , // Sort operation events
145
+ "flushdb" , // Database flush events
146
+ "flushall" : // All databases flush events
117
147
return true
118
148
default :
119
149
return false
0 commit comments