Class EventMessageHandler

java.lang.Object
com.skava.event.EventMessageHandler

@Component public class EventMessageHandler extends Object
The Class EventMessageHandler.
  • 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

      public void sendMessageToQueue(String queue, byte[] body, Map<String,Object> headers)
      It send message to queue.
      Parameters:
      queue - the queue
      body - the body
      headers - 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 name
      routeKey - the route key
      body - the body
      headers - the headers