Skip to content

Commit 9881b41

Browse files
committed
docs: microservice-kafka
- there is no `partition` in `context.getMesaage()`
1 parent 48d8368 commit 9881b41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

content/microservices/kafka.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,14 +319,16 @@ To access the original Kafka `IncomingMessage` object, use the `getMessage()` me
319319
@MessagePattern('hero.kill.dragon')
320320
killDragon(@Payload() message: KillDragonMessage, @Ctx() context: KafkaContext) {
321321
const originalMessage = context.getMessage();
322-
const { headers, partition, timestamp } = originalMessage;
322+
const partition = context.getPartition();
323+
const { headers, timestamp } = originalMessage;
323324
}
324325
@@switch
325326
@Bind(Payload(), Ctx())
326327
@MessagePattern('hero.kill.dragon')
327328
killDragon(message, context) {
328329
const originalMessage = context.getMessage();
329-
const { headers, partition, timestamp } = originalMessage;
330+
const partition = context.getPartition();
331+
const { headers, timestamp } = originalMessage;
330332
}
331333
```
332334

0 commit comments

Comments
 (0)