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

Using kafkajs library in Kafka transporter #1226

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dev/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const broker = new ServiceBroker({
}
},
*/
//transporter: "kafka://192.168.0.181:9092",
transporter: "kafka://127.0.0.1:9093",
//transporter: "amqp://192.168.0.181:5672",
transporter: "NATS",
//transporter: "NATS",
//serializer: "MsgPack",
//requestTimeout: 1000,

Expand All @@ -34,7 +34,7 @@ const broker = new ServiceBroker({
//discoverer: "Etcd3"
},

cacher: true,
//cacher: true,

metrics: {
enabled: false,
Expand Down Expand Up @@ -80,8 +80,8 @@ const broker = new ServiceBroker({
logger: console,
logLevel: "info",
middlewares: [
//Middlewares.Transmit.Encryption("moleculer", "aes-256-cbc"),
//Middlewares.Transmit.Compression(),
// Middlewares.Transmit.Encryption("moleculer", "aes-256-cbc"),
// Middlewares.Transmit.Compression()
//Middlewares.Debugging.TransitLogger({ logPacketData: false, /*folder: null, colors: { send: "magenta", receive: "blue"}*/ }),
//Middlewares.Debugging.ActionLogger({ logParams: true, logResponse: true, /*folder: null, colors: { send: "magenta", receive: "blue"}*/ }),
//require("./RedisHeartbeat")
Expand Down
8 changes: 4 additions & 4 deletions dev/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const broker = new ServiceBroker({
}
},
*/
//transporter: "kafka://localhost:9093",
transporter: "kafka://localhost:9093",
//transporter: "amqp://192.168.0.181:5672",
//transporter: "AMQP10",
transporter: "NATS",
//transporter: "NATS",
//serializer: "MsgPack",

//disableBalancer: true,
Expand Down Expand Up @@ -63,8 +63,8 @@ const broker = new ServiceBroker({
logLevel: "info",

middlewares: [
//Middlewares.Transmit.Encryption("moleculer", "aes-256-cbc"),
//Middlewares.Transmit.Compression(),
// Middlewares.Transmit.Encryption("moleculer", "aes-256-cbc"),
// Middlewares.Transmit.Compression()
//Middlewares.Debugging.TransitLogger({ logPacketData: false, /*folder: null, colors: { send: "magenta", receive: "blue"}*/ }),
//Middlewares.Debugging.ActionLogger({ logPacketData: false, /*folder: null, colors: { send: "magenta", receive: "blue"}*/ }),
//require("./RedisHeartbeat")
Expand Down
1 change: 1 addition & 0 deletions examples/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
"no-var": ["warn"],
"no-console": ["off"],
"no-unused-vars": ["off"],
"no-mixed-spaces-and-tabs": ["off"],
"security/detect-possible-timing-attacks": ["off"]
}
};
13 changes: 7 additions & 6 deletions examples/opentelemetry/opentelemetry.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ module.exports = {
delete ctx.meta.$otel;
}

const actionObj = ctx.action
? {
name: ctx.action.name,
rawName: ctx.action.rawName
}
: null;
let tags = {
callingLevel: ctx.level,
action: ctx.action
? {
name: ctx.action.name,
rawName: ctx.action.rawName
}
: null,
action: actionObj,
remoteCall: ctx.nodeID !== ctx.broker.nodeID,
callerNodeID: ctx.nodeID,
nodeID: ctx.broker.nodeID,
Expand Down
Loading