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

[FEATURE] Make base64 encoding optional #10

Open
ErlendFax opened this issue Sep 5, 2022 · 2 comments
Open

[FEATURE] Make base64 encoding optional #10

ErlendFax opened this issue Sep 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ErlendFax
Copy link

Is your feature request related to a problem? Please describe.
Metamorphosis writes messages to topics on this format:
{Topic: "myMqttTopic", Content: "aHR0cHM6Ly95b3V0dS5iZS9kUXc0dzlXZ1hjUQ=="}.

We are using Redpanda Console / Kowl to monitor the stream, the encoded Content value is difficult to read when we need a quick overview. Also, we are not using encoding in other topics and applications.

Describe the solution you'd like
Make the base64 encoding optional with a env variable.

@ErlendFax ErlendFax added the enhancement New feature or request label Sep 5, 2022
@perbu
Copy link
Member

perbu commented Sep 6, 2022

This is potentially problematic as we have no idea what the messages contain. What we get from MQTT is binary data and as such the only safe way is to encode it. This is the default encoding in Go when creating JSON that might contain binary data ([]byte). As such there is no explicit encoding in Metamorphosis. It all happens automatically.

In my opinion the decoding from base64 should happen on the consumer side.

We've been wondering about the same thing. We have our own APIs to inspect traffic in Kafka and in these APIs we decode.

Perhaps you ask the Redpanda ppl to decode this in the console? I suspect we're not the only ones who are encoding data in Kafka/Redpanda like that.

@perbu
Copy link
Member

perbu commented Oct 4, 2022

I've done this in a similar codebase. It seems to work well. I'll see if I can do it here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants