Workers will listen on a distributed Queue for new Quizzes to process:
- Avoiding more than one Quiz per surveyed (distributed LOCK scope).
- Updating Quizzes with additional data.
- Storing Quizzes into Apache Ignite's distributed database (SQL Query Entity).
- Updating global stats.
Mule flow to listen on distributed Queue for new Quizzes to process, ensuring uniqueness:
Mule flow to process Quizzes:
Configure IP finder on ignite-config.xml as org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder
with the kubernetes service name to find server nodes and the namespace.
<bean id="ignite-config" class="org.apache.ignite.configuration.IgniteConfiguration">
...
<!-- Explicitly configure TCP discovery SPI -->
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
<!--
Enables Kubernetes IP finder and set namespace and service name (cluster) to find SERVER nodes.
-->
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.kubernetes.TcpDiscoveryKubernetesIpFinder">
<property name="shared" value="true" />
<property name="namespace" value="my-mule4-stack" />
<property name="serviceName" value="ignite-cluster-one-service" />
</bean>
</property>
</bean>
</property>
...
</bean>
- Namespace
my-mule4-stack
, serviceignite-cluster-one-service
and servicemule-worker-app-service
for discovery and spring management are defined in k8s configuration yaml for mandatory artifacts - Will be started as a micro-service using Spring Boot Mule 4 Runtime CE docker image, see StatefulSet configuration yaml for Worker
Build application:
mvn clean package