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

WILDCARDs and TLS configuration added #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

snuids
Copy link

@snuids snuids commented Dec 18, 2022

I required the TLS config to connect to AMAZON. I also wanted to use wildcard subscritions in order to listens to multiple topics in a single subscription.

Tested with AWS IOT core.

I learned GO this morning so I could have done some things stupidly. Coming from the C++, GO looks nice.

@CLAassistant
Copy link

CLAassistant commented Dec 18, 2022

CLA assistant check
All committers have signed the CLA.

@snuids snuids changed the title WILDCARDs and TLC added WILDCARDs and TLS configuration added Dec 19, 2022
@mathsman5133
Copy link

Hi, this would be fantastic - is there any update?

@mampersat
Copy link

+1

@mampersat
Copy link

Recommend changing this line , adding the TCPS scheme
Current:
tooltip="Supported schemes: TCP (tcp://), TLS (tls://), or WebSocket (ws://)"
Suggested:
tooltip="Supported schemes: TCP (tcp://), TCPS (tcps://), TLS (tls://), or WebSocket (ws://)"

TCPS is the protocol I needed to use to get this to work with our AWS broker.

@snuids
Copy link
Author

snuids commented Nov 10, 2023

Hi guys thanks for your positive comments, but I did not have any news from Grafana since 10 months :-(

Comment on lines +113 to +121
var payload = msg.Payload()
var data map[string]interface{}
err := json.Unmarshal([]byte(msg.Payload()), &data)
data["Topic"] = msg.Topic()
if err == nil {
log.DefaultLogger.Info("%s", data)
payload, _ = json.Marshal(data)
}

Copy link
Contributor

@NiklasCi NiklasCi Jan 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var payload = msg.Payload()
var data map[string]interface{}
err := json.Unmarshal([]byte(msg.Payload()), &data)
data["Topic"] = msg.Topic()
if err == nil {
log.DefaultLogger.Info("%s", data)
payload, _ = json.Marshal(data)
}
var data map[string]interface{}
err := json.Unmarshal([]byte(msg.Payload()), &data)
if err != nil {
log.DefaultLogger.Error("Failed to unmarshal payload of", msg)
return
}
data["Topic"] = msg.Topic()
payload, err := json.Marshal(data)
if err != nil {
log.DefaultLogger.Error("Failed to marshal data to new payload", data)
return
}

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

Successfully merging this pull request may close these issues.

5 participants