Package overit.geocall.event.producer
Interface MessageProducer<S,T>
- Type Parameters:
S- type of the message class that will be sent to the targetT- 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 TypeMethodDescriptiondefault voidinit(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 payloadproducerProperties- properties that define the producerclassDTO- schema name of the data transfer objectscope- scope of the message related to the type of event triggered- Returns:
MessageResultthe result that has been acknowledged by the Message Broker- Throws:
MessageDispatchException- in case of failure while sending the message
-
init
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
-