Sponge Overview

1. Sponge

Sponge is an open-source, Java-based action and event processing service with a mobile client application.

This documentation applies to version 1.18.0 (release date: 2021-09-15).

Sponge is a software product for implementing synchronous actions and asynchronous event processors. Event processors listen to certain events and perform specified operations when some conditions are met. Events are usually sent by external systems. Sponge allows to introduce temporal and logical conditions to processed events. Event processing may end up with sending of another, high-level event thus creating a hierarchical model of events. The supported event processors include filters, triggers, rules and correlators.

There are several ways to use Sponge:

  • Embed Sponge as a software library in your Java application using Maven dependency.

  • Download the Sponge standalone command-line program and use it in your environment.

  • Run the Sponge standalone command-line program in a Docker container.

  • Connect to a Sponge service via the Remote API.

  • Connect to a Sponge service via the Sponge Remote mobile application (currently in alpha phase) or a custom mobile app build with the Sponge Flutter API (currently in alpha phase).

Actions and event processors are grouped in knowledge bases. A knowledge base is defined in files which may be written in one of several supported scripting languages, i.e. Python, Ruby, Groovy, JavaScript as well as in Java or Kotlin.

In some aspects Sponge may be classified as a Complex Event Processing.

Sponge requires Java 1.8 or above.

The project pages are hosted at https://sponge.openksavi.org. The source code is hosted at Github.

Sponges draw in a current of water to extract nutrients and oxygen.

— Oxford Dictionaries

2. Features

The main features of Sponge:

  • Provides a concurrent processing of actions and incoming events.

  • Allows generating and scheduling of events (e.g. supports cron notation).

  • Events may represent such diverse entities as, for example, SNMP traps, RSS feeds or MIDI messages.

  • Allows embedding in a custom Java application (using Maven) or could be used as a standalone command-line application.

  • Supports connecting to many types of external systems by using Apache Camel integration.

  • Provides own Apache Camel component for including Sponge engine in a Camel route.

  • Provides plugins for integration with Spring, Camel, CPython, MIDI and Raspberry Pi.

  • Supports creation of custom plugins.

  • Supports deployment in enterprise environments by integration with Spring framework.

  • The standalone command-line application allows, for example, management of Camel routes without the need of writing Java code (you may use any of the supported scripting languages or XML).

  • Supports reloading of knowledge bases on the fly (i.e. while the system is running).

  • Supports processing of streams of Sponge events by using Reactive Extensions (ReactiveX).

  • Allows publishing a custom Remote API of your application or your microservice as a set of actions (e.g. written in a scripting language) that may be changed and reloaded on the fly.

  • Provides Remote API client libraries for Java and Dart to simplify writing a client code.

  • Provides integration with TensorFlow, an open source machine learning framework. You may use the TensorFlow or Keras Python API indirectly from your Java application.

  • Provides Sponge Remote (currently in alpha phase), a generic, minimalistic, opinionated mobile application backed by a server-side business logic. The business logic is placed in Sponge actions. Sponge Remote provides a generic GUI to call those actions. Sponge Remote could be useful in cases when a mobile GUI doesn’t have to be customized.

  • Allows development of mobile applications using the Sponge Flutter API library (currently in alpha phase) for cases when the GUI that connects to Sponge has to be customized.

  • Provides a comprehensive documentation and many examples.

3. Applications

Sponge could be used as a component in various types of applications. Here are some examples.

Task automation

Tasks could be programmed in any of the supported scripting languages as Sponge actions, published via the Remote API and called or managed remotely in the Sponge Remote mobile client application.

Internet of Things (IoT)

Sponge as a part of an IoT gateway can locally process data provided by the devices in the field, thus only important data is sent to the central node where data is collected, stored and manipulated by enterprise applications.

Edge computing and fog computing

Sponge may be used on edge devices (also known as smart devices), providing a computation platform that would be largely or completely performed on distributed device nodes. The requirement is that such device must have Java (JRE) installed. The example is Raspberry Pi with connected sensors.

Minimum viable product (MVP)

The Sponge Remote mobile app (or a custom mobile app build with the Sponge Flutter API) along with Sponge services can be used as an early version of a product with just enough features to satisfy early customers and provide feedback for future product development.

Business Activity Monitoring (BAM)

Sponge embedded in a Spring based application may have an access to a service layer via Spring beans. Sponge could periodically run monitoring tasks and generate notification events if necessary.

Fault management

Sponge may be used to process faults or events sent by the network using a protocol such as SNMP. The processing may include creating issues into the issue tracking system (Trouble Ticket system). Sponge may use all protocols supported by Apache Camel or provided by custom plugins.

Network monitoring

Sponge may be used to monitor a web server by periodically sending an HTTP request to fetch a page. It may also provide more advanced checks by running for example Selenium scripts to verify a web application. When a problem is detected Sponge could send an email to the administrator.

Supervisory control and data acquisition (SCADA)

Sponge may be used as a part of Alarm handling as well as a part of a module that connects to the remote terminal units (RTUs) or the field sensors and actuators.

Distributed control system (DCS)

Sponge may be used as a part of the production control level to provide an event-driven monitoring.

System integration

Sponge may be used to provide a script-based integration using Apache Camel routes. Sponge could be connected to the Enterprise Service Bus (ESB) as well.

Learning scripting languages

Sponge with the Sponge Remote mobile app can aid in learning scripting languages (e.g. Python, Ruby, Groovy) or make it more fun. That is because Sponge action arguments and results can be managed in the mobile app GUI.

4. Users

The potential users of an embedded Sponge are Java developers.

The potential users of a standalone command-line Sponge application are:

  • Java, Python, Ruby, Groovy and JavaScript developers,

  • DevOps engineers and system administrators with programming skills.

Because of Sponge is a Java-based solution, at least basic knowledge of Java is suggested. It becomes important when browsing Javadoc API, using Java libraries, analyzing exception stack traces, etc. Moreover, to effectively use Sponge for problems that require integration, a knowledge of Apache Camel becomes important.

The Sponge mobile client application is intended for end users with no programming knowledge required.

5. License

Sponge is released under the Apache 2.0 license.

6. Considerations

  • Because of Sponge doesn’t introduce its own notation for knowledge bases, it provides a shorter learning curve for users that are familiar with one of the supported scripting languages. However it could lack more sophisticated features and could be less optimized for certain uses than other solutions. For example you specify event conditions by writing any code in a scripting language that is to be executed when a matching event happens. On one hand it gives you a flexibility and on the other hand it doesn’t provide optimizations that could be possible if, for example, a strict temporal reasoning notation is used.

  • Sponge doesn’t provide persistence of events out of the box.

7. Author’s note

We have been using Open Source Software in our commercial products for many years. Therefore we appreciate the impact of Open Source on the IT industry and believe that its constant development is important. In order to contribute to the Open Source community we share and maintain projects such as Sponge.

— Marcin Paś
Creator of Sponge, Co-Founder & CTO at Softelnet