Skip to content

feat(analyser): expose destination topic to Analyser via Message.destinationName#2068

Open
krital wants to merge 1 commit intodevelopmentfrom
feat/analyser-destination-context
Open

feat(analyser): expose destination topic to Analyser via Message.destinationName#2068
krital wants to merge 1 commit intodevelopmentfrom
feat/analyser-destination-context

Conversation

@krital
Copy link
Copy Markdown
Contributor

@krital krital commented Apr 17, 2026

Summary

  • Adds a transient destinationName field to Message, set by the engine in Protocol.processMessageAnalyser() immediately before calling analyser.ingest()
  • Gives Analyser implementations access to the MAPS topic a message arrived on, with no impact on serialisation, persistence, or existing analysers

Motivation

Currently Analyser.ingest(Message) has no way to know which topic the message came from. The engine caches one Analyser instance per topic (topicNameAnalyserMap), but a router-style analyser that manages multiple per-topic models internally needs the destination at ingest time.

This is needed to support MicroGptRouterAnalyser in the upcoming maps-microgpt-mavlink-demo: a single Analyser plugin that maintains one micro-GPT model per subscribed topic, routing by msg.getDestinationName().

Changes

Two files, five lines added:

  • Message.java — new @Getter @Setter private transient String destinationName in the existing transient-data fold (same pattern as lastMessage and bound)
  • Protocol.java — one line: msg.setDestinationName(parsedMessage.getDestinationName()) before analyser.ingest(msg)

Test Plan

  • Existing tests pass (no behavioural change for analysers that ignore destinationName)
  • Confirm field is not included in Message.pack() / serialisation (it is transient)
  • Verify a custom Analyser can read msg.getDestinationName() and get the correct MAPS topic

🤖 Generated with Claude Code

…inationName

Add a transient `destinationName` field to `Message`, set by the engine in
`Protocol.processMessageAnalyser()` immediately before calling `analyser.ingest()`.

This gives Analyser implementations access to the MAPS topic the message arrived
on, enabling topic-aware routing within a single Analyser instance — for example,
a MicroGptRouterAnalyser that maintains per-topic models keyed by destination.

The field is transient (not serialised/persisted) and follows the same pattern as
the existing `lastMessage` and `bound` transient fields on Message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

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: Pro

Run ID: 1b512d13-b24e-44fc-a5ce-b7a85cabbec9

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/analyser-destination-context

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 and usage tips.

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