Skip to content

EDG-788: Nevsky v2 — file-v2 and http-v2 production adapter modules#1606

Merged
caoccao merged 4 commits into
initiative/nevsky-protocol-adapter-v2from
feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters
Jul 14, 2026
Merged

EDG-788: Nevsky v2 — file-v2 and http-v2 production adapter modules#1606
caoccao merged 4 commits into
initiative/nevsky-protocol-adapter-v2from
feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters

Conversation

@caoccao

@caoccao caoccao commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

Ports the File and HTTP protocol adapters to SDK v2 (Project Nevsky) as new, parallel, production-listable modules, running side by side with the untouched v1 modules. Distinct protocol-ids (file-v2 / http-v2) and Java packages (…adapters.file.v2 / …adapters.http.v2); disjoint config sections, factory registries, and REST surfaces — the two never interact.

hivemq-edge-module-file-v2

  • Stateless northbound poll-only reader on AbstractProtocolAdapter (File has no connection, so doConnect acknowledges immediately).
  • The five content types (BINARY, TEXT_PLAIN, TEXT_JSON, TEXT_XML, TEXT_CSV) and the 64 KB size cap are ported verbatim.
  • Empty capabilities() — no write, browse, or subscription.

hivemq-edge-module-http-v2

  • Owns the JDK java.net.http.HttpClient across doConnect/doDisconnect (optional trust-all TLS gated behind allowUntrustedCertificates, default off) — no third-party HTTP dependency.
  • doPoll fires sendAsync and reports through the thread-safe output façade from the client's completion thread, preserving v1's per-cycle parallelism; the per-request timeout bounds every in-flight poll.
  • GET/POST/PUT, custom headers, per-tag body/timeout, HiveMQ-Edge; <version> User-Agent, JSON/Base64 response decoding, and success-status filtering carried over.

Build / distribution wiring

  • settings.gradle.kts includeBuild for both modules.
  • build.gradle.kts edgeModule(...) + edgeProjectsToUpdate entries so both ship in the distribution and are module-loader discovered as listable v2 types.
  • Each module mirrors the v1 module build (shadow jar + third-party-license consumable) so it slots into hivemqEdgeZip/hivemqEdgeFullZip.

Parity deltas (documented per-module README)

  1. No auto-removal after repeated poll errors — the framework counts failures with escalating log severity instead.
  2. The MQTT payload envelope belongs to the framework's northbound mappings.
  3. The poll interval is per-tag (TagEntity.pollIntervalMillis).
  4. HTTP: the dormant v1 southbound write path is excluded under strict parity (documented extension point).

Tests

  • Module check green for both (file-v2: 7 test files; http-v2: 8, including an in-process JDK HttpServer + Awaitility for the async/concurrency/timeout paths). ErrorProne/NullAway clean, Spotless clean.
  • Wired end-to-end coverage lives in the companion hivemq-edge-test PR.

Related PRs

  • hivemq-edge-test: wired e2e suites + module-loader binary wiring.
  • hivemq-edge-composite: composite distribution wiring.

@cla-bot cla-bot Bot added the cla-signed label Jul 7, 2026
@caoccao caoccao force-pushed the feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters branch from c0b924f to 3311471 Compare July 7, 2026 12:40
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Test Results

  633 files  +10    633 suites  +10   7m 18s ⏱️ +10s
5 497 tests +66  5 494 ✅ +66  3 💤 ±0  0 ❌ ±0 
5 517 runs  +66  5 514 ✅ +66  3 💤 ±0  0 ❌ ±0 

Results for commit e41ba25. ± Comparison against base commit a52c8f6.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Coverage Report

Overall Project 66.85% -0.09%
Files changed 85.63%

File Coverage
FileAdapterConfiguration.java 100%
FileContentType.java 100%
MappingException.java 100%
HttpMethod.java 100%
HttpContentType.java 100%
HttpHeader.java 100%
HttpProtocolAdapterFactory.java 96.24% -3.76%
HttpAdapterConfiguration.java 93.58% -6.42%
FileProtocolAdapterFactory.java 89.74% -10.26%
HttpNode.java 83.87% -16.13%
FileProtocolAdapter.java 82.94% -17.06%
HttpProtocolAdapterInformation.java 80.65% -19.35%
FileProtocolAdapterInformation.java 80% -20%
FileNode.java 77.08% -22.92%
HttpProtocolAdapter.java 76.2% -23.8%

@caoccao caoccao force-pushed the initiative/nevsky-protocol-adapter-v2 branch from 094db0e to b1e80b8 Compare July 8, 2026 06:43
@caoccao caoccao force-pushed the feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters branch from 3311471 to 277a947 Compare July 8, 2026 06:55
caoccao added 2 commits July 9, 2026 14:08
Port the File and HTTP protocol adapters to SDK v2 as new, parallel,
production-listable modules, running side by side with the untouched v1
modules (distinct protocol-ids file-v2 / http-v2 and packages).

- hivemq-edge-module-file-v2: a stateless northbound poll-only reader on
  AbstractProtocolAdapter; the five content types and the 64 KB size cap are
  ported verbatim; empty capabilities().
- hivemq-edge-module-http-v2: owns the JDK HttpClient across connect/disconnect
  (with optional trust-all TLS); doPoll fires sendAsync and reports through the
  thread-safe output facade, preserving v1's per-cycle parallelism; JSON/Base64
  response decoding and success-status filtering carried over.
- Build/distribution wiring: settings.gradle.kts includeBuild, build.gradle.kts
  edgeModule and edgeProjectsToUpdate entries, so both modules ship in the
  distribution and are module-loader discovered as listable v2 types.

Parity deltas are documented per-module: no auto-removal after repeated poll
errors, the MQTT envelope belongs to the framework's northbound mappings, and
the poll interval is per-tag.
@caoccao caoccao force-pushed the feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters branch from 0ee3034 to 682327b Compare July 9, 2026 12:09
@caoccao caoccao marked this pull request as ready for review July 9, 2026 14:16

@marregui marregui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found a few nits worth addressing

@caoccao

caoccao commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

All inline review feedback has been addressed or clarified in e41ba25. The File v2 and HTTP v2 module tests plus Spotless checks pass. Each inline thread now has a dedicated response and is resolved.

@marregui marregui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@caoccao caoccao merged commit 5061042 into initiative/nevsky-protocol-adapter-v2 Jul 14, 2026
8 checks passed
@caoccao caoccao deleted the feat/edg-788/nevsky-create-file-v2-and-http-v2-adapters branch July 14, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants