Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Analysis

...

The EPS service enables devices and systems that generate events/data/messages needed by other consumers to publish those events to an intermediary that is responsible for their subsequent distribution to interested parties.

...

publishEvent() implementation is for publication push messages by getting corresponding kafka topic. 

Design

1) RobustTopic.java -  First we have to write new class RobustTopic which extends CommonTopicBase and implement publishEvent() method which intern connect to Kafka broker implementation class(BrokerManagementServiceImpl) to push event/messages into kafka server.

2) Add RobustTopic bean definition in Topics.xml file.

<!-- Robust topic section -->
<bean class="org.socraticgrid.hl7.services.eps.internal.model.RobustTopic"
name="kafkatopic" id="kafkatopic">
<property name="subTopics">
<map>
<entry key="KafkaTopic">
<ref bean="kafkaTopicBean" />
</entry>
</map>
</property>
</bean>

<bean name="kafkaTopicBean" id="kafkaTopicBean"
class="org.socraticgrid.hl7.services.eps.internal.model.RobustTopic">
<property name="parentTopic" ref="kafkatopic" />
<property name="topic">
<bean class="org.socraticgrid.hl7.services.eps.model.Topic">
<property name="name" value="Test Kafka Topic" />
<property name="optionsList">
<bean class="org.socraticgrid.hl7.services.eps.model.Options">
<property name="access" value="Open"></property>
<property name="durability" value="Robust"></property>
</bean>
</property>
<!-- <property name="publicationInterventions">
<list>
<ref bean="FHIRLabReview"/>
<ref bean="FHIRHCSReview"/>
</list>
</property> -->
</bean>
</property>
</bean>

3) Update StaticTopicTree bean definition in TopicsLocation.xml file which refers to kafkatopic bean. By doing this change, StaticTopicTree class locateTopic returns will be injected with RobustTopic instead of TransientTopic.

<bean id="BaseStaticLocator" name="BaseStaticLocator"
class="org.socraticgrid.hl7.services.eps.internal.StaticTopicTree">
<property name="rootTopic" ref="kafkatopic" />
</bean>

Assumptions: Following are the assumptions when we use publication 

...