Interface MessageProducer<S,T>

Type Parameters:
S - type of the message class that will be sent to the target
T - type of the result class obtained by the implementing producer
All Known Implementing Classes:
SNSMessageProducer

public interface MessageProducer<S,T>
Interface representing the generic message producer, that will issue a message onto a given channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    init(ProducerProperties producerProperties)
    This method is called by MessageProducerService after initialization and before calling the send() method.
    send(S message, ProducerProperties producerProperties, String classDTO, MessageScope scope)
    Emits the notification on a given channel
  • Method Details

    • send

      MessageResult send(S message, ProducerProperties producerProperties, String classDTO, MessageScope scope) throws MessageDispatchException
      Emits the notification on a given channel
      Parameters:
      message - the object to be sent as payload
      producerProperties - properties that define the producer
      classDTO - schema name of the data transfer object
      scope - scope of the message related to the type of event triggered
      Returns:
      MessageResult the result that has been acknowledged by the Message Broker
      Throws:
      MessageDispatchException - in case of failure while sending the message
    • init

      default void init(ProducerProperties producerProperties)
      This method is called by MessageProducerService after initialization and before calling the send() method. Allows implementing class to specify operations to be executed before dispatching the message, e.g. additional settings that are needed by the producer for correct configuration.
      Parameters:
      producerProperties - properties that define the producer