8000 603 feature request location ingestion via mqtt by dgraf-gh · Pull Request #664 · dedicatedcode/reitti · GitHub
[go: up one dir, main page]

Skip to conte 8000 nt

Conversation

@dgraf-gh
Copy link
Contributor

No description provided.

- Added Mosquitto MQTT container for testing purposes
- Introduced `DynamicMqttProvider` service to handle dynamic MQTT connections
- Added `MqttIntegration` and `PayloadType` to configure client settings
- Implemented `MqttPayloadProcessor` interface for payload processing
- Integrated HiveMQ MQTT client dependencies
- Added `UserJdbcService` for managing users in MQTT configuration
- Updated `DynamicMqttProvider` to support user-specific connections
- Implemented `testConnection` method for verifying MQTT connectivity
- Improved client connection handling and introduced QoS settings
- Added `MqttIntegrationJdbcService` for database interactions
- Created OwnTracks payload processor for handling location data
- Added database migration script for `mqtt_integrations` table
…ository pattern with:

1. A method to find an MQTT integration by user
2. A save method that handles both create and update scenarios
3. Separate create and update methods
4. A row mapper to convert database rows to domain objects
5. Optimistic locking using a version field

The code handles nullable timestamps, uses prepared statements for safe parameter insertion, and follows the existing code style.

Would you like me to elaborate on any part of the implementation?
- Added `createdAt`, `updatedAt`, `lastUsed`, and `version` fields to `MqttIntegration`
- Updated database operations to handle new fields
- Replaced manual test user creation with `TestingService.randomUser` in tests
- Fixed incorrect RabbitMQ container import in `TestContainerConfiguration`
…grations

- Deleted `MqttIntegrationSettingsController` in favor of consolidating logic in `IntegrationsSettingsController`
- Added support for saving and testing MQTT integrations in `IntegrationsSettingsController`
- Refactored `MqttIntegration` with builder-like methods for easier updates
- Simplified redirection and flash messaging for better user feedback
- Improved CSS styling for read-only input elements
…troller

- Updated `IntegrationsSettingsController` to use consistent parameter names prefixed with `mqtt_`
- Adjusted HTML form inputs in `integrations.html` to align with updated parameter naming
- Replaced `autocomplete="off"` with `autocomplete="new-password"` for better security practices
- Added detailed logging for MQTT client connection, subscription, and errors in `DynamicMqttProvider`
- Refactored `remove` method to use `User` object instead of `userId`
- Updated `IntegrationsSettingsController` to dynamically register or remove MQTT clients based on integration status
- Updated log level from `debug` to `info` in `DynamicMqttProvider` for client connection messages
- Log username when disconnecting MQTT client in `DynamicMqttProvider`
- Add `OwnTracksProcessor` to handle and process location messages
- Integrate `LocationBatchingService` to queue validated location points
- Add JSON parsing and validation for OwnTracks payloads
- Improve MQTT disconnection log message in `DynamicMqttProvider`
…ngestion

- Add `DynamicMqttProviderIntegrationTest` for comprehensive MQTT location processing validation
- Add `mosquitto-no-auth.conf` configuration for Mosquitto MQTT test container
- Enhance `DynamicMqttProvider` with `MqttStatus` enum for connection state tracking
- Update test container to load Mosquitto configuration file
@dgraf-gh dgraf-gh linked an issue Jan 10, 2026 that may be closed by this pull request
@dgraf-gh dgraf-gh added the enhancement New feature or request label Jan 10, 2026
@dgraf-gh dgraf-gh merged commit 8fd37fd into main Jan 10, 2026
2 of 3 checks passed
@dgraf-gh dgraf-gh deleted the 603-feature-request-location-ingestion-via-mqtt branch January 10, 2026 13:22
@tobru
Copy link
tobru commented Jan 11, 2026

Does this also support MQTT over TLS (usually on port 8883)? I run my MQTT broker publicly and only allow encrypted TLS connections.

@dgraf-gh
Copy link
Contributor Author

Does this also support MQTT over TLS (usually on port 8883)? I run my MQTT broker publicly and only allow encrypted TLS connections.

I assume that the used library supports this out of the box. But I will test this before dping the release.

@tobru
Copy link
tobru commented Jan 11, 2026
Screenshot_20260111_103409

MQTT connection test failed: com.hivemq.client.mqtt.mqtt3.exceptions.Mqtt3DisconnectException: Timeout while waiting for CONNACK

I think there needs to be a specific "use TLS" setting which is passed to the library, I don't think there is any "magic" which automatically chooses TLS.

@dgraf-gh
Copy link
Contributor Author

Thanks for testing it. Let me add it

@dgraf-gh
Copy link
Contributor Author

Hello @tobru,

PR #668 is done. I added a tls flag to the configuration. Give it a couple of minutes after the merge and try it again when it suits you.

@tobru
Copy link
tobru commented Jan 11, 2026

MQTT connection test successful 🥳

Thanks! Will do some more tests in the coming days.

@tobru
Copy link
tobru commented Jan 18, 2026

Just for the record: I used MQTT ingestion the past few days, and I can report that it works perfectly well!

@dgraf-gh
Copy link
Contributor Author

Just for the record: I used MQTT ingestion the past few days, and I can report that it works perfectly well!

Thank you for the feedback

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

Successfully merging this pull request may close these issues.

[Feature Request] Location ingestion via MQTT

3 participants

0