Skip to content

feat: add mqtt library - #7

Merged
jason-lynch merged 2 commits into
mainfrom
jason-lynch/mqtt-library
Jan 14, 2025
Merged

feat: add mqtt library#7
jason-lynch merged 2 commits into
mainfrom
jason-lynch/mqtt-library

Conversation

@jason-lynch

Copy link
Copy Markdown
Member

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.

Base automatically changed from jason-lynch/server-module to main January 14, 2025 14:24
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
jason-lynch force-pushed the jason-lynch/mqtt-library branch from fded04f to e1786db Compare January 14, 2025 14:27
@jason-lynch
jason-lynch merged commit 06ab62f into main Jan 14, 2025
@jason-lynch
jason-lynch deleted the jason-lynch/mqtt-library branch January 14, 2025 19:26
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.
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.

2 participants