Class ChenilePubSubInitializer
java.lang.Object
org.chenile.pubsub.init.ChenilePubSubInitializer
- All Implemented Interfaces:
InitializingBean
Detects the
When a service is subscribed, all operations under the service will be subscribed automatically.
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 Summary
FieldsModifier and TypeFieldDescription(package private) ApplicationContextprivate final Stringprivate final String(package private) ChenileConfiguration(package private) org.slf4j.Logger(package private) final booleanprivate PubSubEntryPointprivate String(package private) final WildCardsTopic -
Constructor Summary
ConstructorsConstructorDescriptionChenilePubSubInitializer(boolean enabled, String basePublishTopic, String baseSubscribeTopic, WildCardsTopic wildCardsTopic) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidinit()private voidputAnnotationBackIntoServiceDefinition(String publishTopic, String subscribeTopic, int qos, String serviceId) Put the details of the data structure back into the service definition.
-
Field Details
-
logger
org.slf4j.Logger logger -
chenileConfiguration
-
pubSubEntryPoint
-
separator
-
applicationContext
-
pubSubConfig
-
pubsubEnabled
final boolean pubsubEnabled -
wildCardsTopic
-
basePublishTopicName
-
baseSubscribeTopicName
-
-
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 remotelysubscribeTopic- - the topic to subscribe for the serviceqos- - the qos level to subscribe toserviceId- - the service Id of the service that gets mapped to the topic and qos
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-