Karaf: Scheduling GoGo Commands Via Blueprint

A new feature with mhu-lib 3.3 is the karaf scheduling service. The service is designed to be configured by blueprint and executes gogo-shell scripts. In this way you are able to execute every regular maintenance by automation.

Use this sample blueprint to print a hello world for every 2 minutes:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    <bean id="cmd" 
          init-method="init" destroy-method="destroy">
      <property name="name" value="cmd_hello"/>
      <property name="interval" value="*/2 * * * *"/>
      <property name="command" value="echo 'hello world!'"/>
      <property name="timerFactory" ref="TimerFactoryRef" />
       interface="de.mhus.lib.core.util.TimerFactory" />
            <entry key="osgi.jndi.service.name" value="cmd_hello"/>


Popular posts from this blog

Creating a flux sync configuration referring a config map for substitution

[dev] Generation 7 - Remove unused prefixes from artifact names

Create Spring Boot Images in Jenkins/CI in K8s, Part 1