Salesforce Decode
Salesforcedecode
Back to questions
LWCIntermediatelmscommunicationarchitecture

Design Lightning Message Service channel catalog for enterprise org

Real World Scenario

Forty LWCs publish to ad-hoc LMS channels named by individual developers causing collisions and orphaned subscribers.

Expected Answer

• Central channel registry document: name, payload schema, owner team • Channel naming convention: appDomain_entity_action • Typed payload interfaces shared via ES module constants • Subscribe in connectedCallback unsubscribe disconnectedCallback mandatory • Avoid LMS for parent-child direct communication—use @api first • Version payload with schemaVersion field for backward compatibility • Jest test publish subscribe with MessageContext mock

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Central channel registry document: name, payload schema, owner team. Channel naming convention: appDomain_entity_action. Pick based on your integration pattern and team capability. LMS without governance becomes event spaghetti—channel catalog is enterprise prerequisite. Balance speed of delivery with maintainability.

Architect Perspective

LMS without governance becomes event spaghetti—channel catalog is enterprise prerequisite.