File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ async function bootstrap() {
97
97
block: 5000 ,
98
98
consumer: ' users-1' ,
99
99
consumerGroup: ' users' ,
100
+ deleteMessagesAfterAck: true , // optional: delete message from stream
100
101
},
101
102
// optional. See our example main.ts file for more details...
102
103
// serialization: {},
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ interface RedisStreamOptionsXreadGroup {
15
15
block ?: number ;
16
16
consumerGroup : string ;
17
17
consumer : string ;
18
+ deleteMessagesAfterAck ?: boolean ;
18
19
}
19
20
20
21
export type RedisStreamOptions = RedisStreamOptionsXreadGroup ;
Original file line number Diff line number Diff line change @@ -153,6 +153,13 @@ export class RedisStreamStrategy
153
153
inboundContext . getMessageId ( ) ,
154
154
) ;
155
155
156
+ if ( true === this . options ?. streams ?. deleteMessagesAfterAck ) {
157
+ await this . client . xdel (
158
+ inboundContext . getStream ( ) ,
159
+ inboundContext . getMessageId ( ) ,
160
+ ) ;
161
+ }
162
+
156
163
return true ;
157
164
} catch ( error ) {
158
165
this . logger . error ( error ) ;
You can’t perform that action at this time.
0 commit comments