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

Mqtt5 Requests Response Topic #11

Open
sabsantina opened this issue Feb 12, 2021 · 4 comments
Open

Mqtt5 Requests Response Topic #11

sabsantina opened this issue Feb 12, 2021 · 4 comments

Comments

@sabsantina
Copy link

Would it be possible to allow someone to pass the response topic for this function

// Request sends a message to broker and waits for the response.
func (m *mqttv5) Request(topic string, payload interface{}, timeout time.Duration, h handler)

At the moment, the current format where the response topic is hardcoded does not allow for what I need. Thank you

@alihanyalcin
Copy link
Owner

alihanyalcin commented Feb 15, 2021

Hi @sabsantina,
I've added RequestWith method for mqttv5 client. Is it cover your need?

https://github.com/alihanyalcin/mqtt-wrapper/blob/master/mqttv5.go#L92

@sabsantina
Copy link
Author

@alihanyalcin, I've tried to use the RequestWith method as it currently is coded and it should cover my needs however I'm always getting a timeout error. At the moment, I am trying to write some tests with gomega/ginkgo to test the payload of specific response topics. I've tried different ways of attempting this but from what I can see the handler is never reached and it just times out.

@alihanyalcin
Copy link
Owner

I have tried request-response with timeout but I did not get any timeout. Which mqtt broker did you use to test it?

@sabsantina
Copy link
Author

The broker uses paho and is installed in a docker image. It requires SSL certificates to be accessed.

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

No branches or pull requests

2 participants