feat: add mqtt library - #7
Merged
Merged
Conversation
cmotyka
approved these changes
Jan 13, 2025
This is a library we developed in the saas that adds a request/response model on top of MQTT. It includes integration tests that use testcontainers, which necessitated a small change to the circleci configuration.
This commit adds two small utilities for performing HTTP requests over
MQTT:
- `HTTPServer`: Serves an `http.Handler` over an arbitrary topic. It
reads raw HTTP requests from the message payload, invokes its handler
and returns an HTTP response.
- `HTTPDoer`: Implements the same `Do` method as `http.Client`. This is
a common interface for libraries that allow a pluggable `http.Client`
implementation. It writes a raw HTTP request to the message payload
and unmarshals an HTTP response from the MQTT call response.
A few other changes to the MQTT library in this commit:
- Support for non-JSON message payloads.
- This was necessary for HTTP support.
- Support for message QoS, expiry, and retention.
- This makes it possible to call a service before it has connected to
the broker and have the service respond once it's online.
- It doesn't make sense to do this for every request, but it's useful
in some cases, such as when we're polling to see if a service has
started successfully.
- Logging improvements
- Defaults to no-op logging, which is more appropriate for a library.
- Removed some error logs where we're returning an error. This
pattern often results in duplicate logs and violates the best
practice of only handling errors once.
jason-lynch
force-pushed
the
jason-lynch/mqtt-library
branch
from
January 14, 2025 14:27
fded04f to
e1786db
Compare
AntTheLimey
added a commit
that referenced
this pull request
Jul 20, 2026
buildS3SetStorageSecretSQL hardcoded use_ssl=true and passed the endpoint through verbatim for any endpoint-present store, which broke plain-HTTP S3 (MinIO / self-hosted) and stored a URL where DuckDB's set_storage_secret wants a bare host:port. Derive use_ssl from the endpoint scheme (https => true, http => false, schemeless => true) and strip the scheme, trimming surrounding whitespace and a trailing slash. The cloud-AWS (endpoint-absent) and Azure paths are unchanged. Finding #7 of the ColdFront single-node trial remediation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a library we developed in the saas that adds a request/response model on top of MQTT. It includes integration tests that use testcontainers, which necessitated a small change to the circleci configuration.