Package com.skava.event
Class EventMessageHandler
java.lang.Object
com.skava.event.EventMessageHandler
The Class EventMessageHandler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
Initialize the listener for queues and topics.void
sendMessageToQueue
(String queue, byte[] body, Map<String, Object> headers) It send message to queue.void
It send message to topic.void
shutdown()
Destroy the producerTemplate during application shutdown.
-
Constructor Details
-
EventMessageHandler
public EventMessageHandler()
-
-
Method Details
-
init
@EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void init()Initialize the listener for queues and topics. -
shutdown
@PreDestroy public void shutdown()Destroy the producerTemplate during application shutdown. -
sendMessageToQueue
It send message to queue.- Parameters:
queue
- the queuebody
- the bodyheaders
- the headers
-
sendMessageToTopic
public void sendMessageToTopic(String topicName, String routeKey, byte[] body, Map<String, Object> headers) It send message to topic.- Parameters:
topicName
- the topic namerouteKey
- the route keybody
- the bodyheaders
- the headers
-