moleculerjs / moleculer-channels

Reliable messages for Moleculer services via external queue/channel/topic.
MIT License
73 stars 15 forks source link

Implement headers in Redis adapter #14

Closed icebob closed 2 years ago

icebob commented 2 years ago

We should implement header support in Redis adapter as well. After it, all adapters support it and we can use it to send moleculer specific properties like tracing IDs. We can store it as serialized string after the payload:

            const id = await clientPub.xadd(
                channelName, // Stream name
                "*", // Auto ID
                "payload", // Entry
                opts.raw ? payload : this.serializer.serialize(payload) // Actual payload
                "headers",
                this.serializer.serialize(headers)
            );