Skip to content

feat(state): send TAK CoT to additional TAK servers - #2259

Open
c310j wants to merge 3 commits into
Maps-Messaging:developmentfrom
c310j:feat/tak-additional-servers
Open

c310j wants to merge 3 commits into
Maps-Messaging:developmentfrom
c310j:feat/tak-additional-servers

Conversation

@c310j

@c310j c310j commented Sep 29, 2026

Copy link
Copy Markdown

Stacked on #2258. This branch contains #2258's two KPI metrics commits plus one new commit (5722b63c8). Please review/merge #2258 first; the diff for this PR alone is that last commit.

Summary

Adds an optional tak.additionalServers list to the TwinManager config, so the CoT that the TAK output composes (including MTI status augmentation) can be delivered to more than one TAK server.

  • Every CoT event, detection and removal is handed to each additional server as the identical XML sent to the primary server.
  • Each additional server gets its own shared TakSocketConnection (connection, bounded queue, writer thread). An unreachable server only fills and drops its own queue; it never delays the primary or the other servers.
  • Each server can have its own TLS settings, key store and trust store, so servers behind different certificate authorities are supported.
  • Per-server health is exported as a new JMX bean type=Integration,name=TakServer,server=<host>_<port>,role=primary|additional (connected, connects, connect failures, disconnects, drops, writes, last write age, queue size). The existing TakOutput counters stay as process-wide totals.
  • New TakServerDTO for the list entries, so TakProtocolDTO doesn't reference itself in the REST schema.

With the list empty (the default), behaviour is unchanged.

Example:

tak:
  hostname: tak.example.org
  port: 8089
  sharedConnection: true
  tlsEnabled: true
  # keyStore / trustStore as today
  additionalServers:
    - hostname: tak2.example.org
      port: 8089
      tlsEnabled: true
      keyStore:   { type: PKCS12, path: /opt/maps/conf/tak2-client.p12, alias: maps, passphrase: ... }
      trustStore: { type: PKCS12, path: /opt/maps/conf/tak2-trust.p12, passphrase: ... }

Test plan

  • AdditionalTakServersTest (real loopback sockets): every server receives the identical CoT event; an unreachable server does not delay delivery to a live one; SSL factory resolved once per server; empty/null lists
  • TakSocketConnectionTest: writes and connect failures are counted per server, and only for that server
  • TwinManagerConfigTest: additionalServers parsed, invalid entries (no hostname) skipped, default empty, written back by toConfigurationProperties
  • All io.mapsmessaging.state.** tests pass (868 run, 0 failures)
  • Live: deployed to an exercise hub with an empty list; primary TAK connection unaffected, and the new per-server bean reports the primary connection (connected, 0 failures, 0 drops)

🤖 Generated with Claude Code

c310j and others added 3 commits September 29, 2026 16:03
Adds the raw data behind the requested MTI coverage, unknown-asset,
per-asset staleness and TAK-output KPIs, kept definition-free so the
thresholds can be decided in the dashboard:

- TwinStatusJMX (name=Twins, per twin type and lifecycle): twin counts
  broken down by MTI state and cumulative MTI-age buckets. Reads the MTI
  cache through a new side-effect-free MtiStatusRegistry snapshot, so
  scrapes don't skew the existing lookup hit/miss counters.
- TakOutputJMX (name=TakOutput): TAK socket connects, connect failures,
  disconnects, open connections, last write age, socket and publisher
  drop counts, and a receipt-to-CoT latency histogram. TakSocketConnection
  previously swallowed every connection failure without any trace.
- MAVLink last message age, for feed-gap detection.

NO-ISSUE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds report-age buckets and joint "reported and MTI-known" counts to
TwinStatusJMX, and a PictureRecoveryTracker that times each asset's
restoration from valid data back at MAPS to a fresh classified CoT handed
to TAK, by failure type (feed loss, restart, MTI status loss) and stage.

NO-ISSUE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds an optional tak.additionalServers list to the TwinManager config.
Every CoT event, detection and removal the TAK output composes is handed
to each additional server as well, so all servers receive the identical
MTI-augmented XML. Each server gets its own shared connection, queue and
writer thread, so an unreachable server only drops its own events and
never delays the primary. Per-server connection health is exported as a
TakServer JMX bean (connected, connects, failures, disconnects, drops,
writes, last write age, queue size).

With the list empty, behaviour is unchanged.

NO-ISSUE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5bcc52cd-f767-49dd-bca7-a312898ed6e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant