1. Sponge

Sponge is an open-source, Java-based Action and Event Processing System.

This documentation applies to version 1.5.0 (release date: 2018-11-08).

Sponge is a software library 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.

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.

Sponge may be classified as a Complex Event Processing system, in some aspects.

Sponge requires Java 1.8 or above.

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

Sponge has been created by Softelnet.

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.

  • Supports writing knowledge bases in several scripting languages.

  • No need to learn yet another notation/DSL, however you have to learn at least the basics of the Sponge API.

  • 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, MPD and Raspberry Pi.

  • Supports creation of custom plugins.

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

  • Provides the standalone command-line application, that, for example, allows 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 REST API of your Java application as a set of actions (e.g. written in a scripting language) that may be changed and reloaded on the fly.

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

  • May be used to automate repetitive tasks (programmed in any of the supported scripting languages).

  • Provides a comprehensive documentation and many examples.

3. License

The Sponge standard libraries are released under the Apache 2.0 license. However some optional Sponge libraries and the Sponge standalone command-line application are licensed under the GNU General Public License, Version 3 because they use optional, third-party libraries that require it.

4. Applications

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

Internet of Things (IoT)

Sponge as a part of an IoT gateway may 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.

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.

5. Users

The potential users of an embedded Sponge are Java developers.

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

  • Python, Ruby, Groovy or JavaScript developers,

  • Java developers (for example for prototyping),

  • 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 routes becomes important.

6. Considerations

  • Because of Sponge doesn’t introduce its own notation for knowledge bases, it provides a shorter learning curve for users that know 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.

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

7. Author’s note

Softelnet has used Open Source Software in its 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ś
Co-Founder & CTO at Softelnet