The type of the event to publish.
The message payload to send to subscribers.
Optional headers to include with the event. If the "sync" header is provided, the event will be published synchronously, and the response will be sent back to the source using the specified sync ID.
An object containing the event type and the number of subscribers the event was published to.
The function checks if there are any subscriptions for the given event type. If no subscriptions exist, it logs a debug message and returns an object indicating zero subscribers. Otherwise, it iterates over the subscribers and publishes the event:
Publishes an event to all subscribers of the specified event type.