Interface MessagingService

All Superinterfaces:
Service

public interface MessagingService extends Service
Messaging service.
  • Field Details

  • Method Details

    • emit

      void emit(String topic, Map<String,Object> message)
      The message Map is interpreted as data map and passed to emit(String, Map, Map). Usually this results in a final message like: {data: message}
      Parameters:
      topic - the topic
      message - the Map to be serialized to JSON and then sent
    • emit

      void emit(String topic, Map<String,Object> data, Map<String,Object> headers)
      Takes a (cloudevents) message, separated into data and headers and sends it to the specified topic of this message broker.

      Usually data and headers are combined into a final JSON string message following the rule: {...headers, data: data}. Brokers (e.g. Kafka) that natively support headers might separate headers from data

      Parameters:
      topic - the topic
      data - the data Map
      headers - the headers Map