Skip to content

Add subscription ID tracking in message publishing #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: ros2
Choose a base branch
from

Conversation

Josme
Copy link

@Josme Josme commented May 16, 2025

Description :
This PR implements subscription ID propagation in message publishing to enable better client-side message tracking. The main changes include:

  1. Added subscription ID (sid) injection for all message formats:
for sid in subscription.clients:
    outgoing_msg = {"op": "publish", 
    "topic": topic, "id": sid}
  1. Enhanced compression format handling with ID preservation:
# For PNG compression
outgoing_msg = {"op": "png", "data": 
encode_png(...), "id": sid}

# For CBOR formats
outgoing_msg["id"] = sid
  1. Implemented per-client message generation logic:
subscription = self._subscriptions.get
(topic)
if subscription:
    for sid in subscription.clients:
        # Message construction per client

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