Class ChenilePubSubInitializer

java.lang.Object
org.chenile.pubsub.init.ChenilePubSubInitializer
All Implemented Interfaces:
InitializingBean

public class ChenilePubSubInitializer extends Object implements InitializingBean
Detects the ChenilePubSub annotated classes in the Application Context and populates the chenileConfig for later use by invalid input: '{@link /*missing*/}' Topic and Qos can be configured at the service level. (not at the operation level)
When a service is subscribed, all operations under the service will be subscribed automatically.
  • Field Details

  • Constructor Details

    • ChenilePubSubInitializer

      public ChenilePubSubInitializer(boolean enabled, String basePublishTopic, String baseSubscribeTopic, WildCardsTopic wildCardsTopic)
  • Method Details

    • init

      @EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) @Order(900) public void init() throws Exception
      Throws:
      Exception
    • putAnnotationBackIntoServiceDefinition

      private void putAnnotationBackIntoServiceDefinition(String publishTopic, String subscribeTopic, int qos, String serviceId)
      Put the details of the data structure back into the service definition.
      This is needed since the init method takes default values that are configured in the annotation and mutates them.
      Parameters:
      publishTopic - - the topic to publish when you want to invoke the service remotely
      subscribeTopic - - the topic to subscribe for the service
      qos - - the qos level to subscribe to
      serviceId - - the service Id of the service that gets mapped to the topic and qos
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface InitializingBean
      Throws:
      Exception