UNPKG

1 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.KafkaContext = void 0;
4const base_rpc_context_1 = require("./base-rpc.context");
5class KafkaContext extends base_rpc_context_1.BaseRpcContext {
6 constructor(args) {
7 super(args);
8 }
9 /**
10 * Returns the reference to the original message.
11 */
12 getMessage() {
13 return this.args[0];
14 }
15 /**
16 * Returns the partition.
17 */
18 getPartition() {
19 return this.args[1];
20 }
21 /**
22 * Returns the name of the topic.
23 */
24 getTopic() {
25 return this.args[2];
26 }
27 /**
28 * Returns the Kafka consumer reference.
29 */
30 getConsumer() {
31 return this.args[3];
32 }
33 /**
34 * Returns the Kafka heartbeat callback.
35 */
36 getHeartbeat() {
37 return this.args[4];
38 }
39 /**
40 * Returns the Kafka producer reference,
41 */
42 getProducer() {
43 return this.args[5];
44 }
45}
46exports.KafkaContext = KafkaContext;