Apama provides real-time streaming analytics and intelligent automated actions on fast-moving data. Apama is a standalone product that is also available as part of Cumulocity IoT, where it also powers Cumulocity IoT-only capabilities, such as the drag-and-drop Analytics Builder.
The latest version of Apama has arrived, version 10.15.3, with a focus on enhancing EPL development. This follows Apama’s commitment to support the latest technology, incorporate the latest security updates and allows you to take advantage of the latest features.
Version 10.15.3
Functional programming in EPL
You can now use functional programming within EPL using the new functional library. Functional programming facilitates passing pure functions as arguments to other functions resulting in more flexible and modular code. By encouraging immutable data structures there is a reduced risk of bugs caused by state changing from outside of a function and therefore it is easier to develop and test robust and reliable applications.
monitor.subscribe(FindAlarmResponse.SUBSCRIBE_CHANNEL);
sequence<Alarm> allAlarms := new sequence<Alarm>;
any _ := Functional(objects)
.map(Fn.getEntry("id")) // get the id from each object.
.map(sendFindAlarm) // send a find alarm for each, returning the ids.
.map(Fn.partial(receiveAlarms, [allAlarms])) // listen for all those alarms.
.waitForAllCompleted(FindAlarmResponseAck.getName(), "reqId", Fn.partial(clearAllAlarms, [allAlarms])); // clear all the alarms we found.
A new knowledge base article on Tech Community guides developers through the new library by working through an example of how to manage Cumulocity IoT alarms in a functional style.
Time zone support in EPL at() event operator
You can now schedule an operation at a specific time even when the time zone of the correlator is not known. For example, when running a correlator in a data center you may wish to schedule an operation at midnight US Eastern time zone which previously required the time zone of the machine hosting the correlator being known to the application.
The at() event operator now supports an optional time zone argument:
on all at(5, 9, *, *, *, Timezone.AMERICA.NEW_YORK) {}
Add fields to event type definitions without breaking existing applications
A common request is to be able to add fields to event type definitions used in existing applications without breaking those applications.
To make this task easier you can now use positional syntax for a subset of event fields.
For example, if we extend an event type definition with a 4th field:
event MyEvent {
float a;
float b;
float c;
float d_newField;
}
Then the following syntax (which may be used by an existing application):
on E(1, 2, 3) {}
Is now semantically equivalent to using:
on E(1, 2, 3, *) {}
The existing application will continue to work without needing to be extended to include the wildcard in the event instance.
HTTP server transport supports multiple chains for incoming requests with the same port but a different HTTP request path
Separate chains allows specific parsing configuration for different paths and can provide performance improvements.
In this example, we can specify distinct mapping rules for requests to “/rest” and to “/rest/objects”:
dynamicChains:
DefaultHTTPServerChain:
- apama.eventMap
mapping rules...
- HTTPServerTransport:
allowedMethods: [GET]
matchPathPrefixes: ""
RESTHTTPServerChain:
- apama.eventMap
mapping rules...
- HTTPServerTransport:
allowedMethods: [GET]
matchPathPrefixes: ["/rest", "/api"]
CRUDHTTPServerChain:
- apama.eventMap
mapping rules...
- HTTPServerTransport:
allowedMethods: [GET,PUT,DELETE,POST]
automaticResponses: false
matchPathPrefixes: ["/rest/objects"]
Find out more
The Community Edition of Apama 10.15.3 is available for you to download now.
More information about the new capabilities mentioned here and other improvements and changes are described in the v10.15.3 release notes in the product documentation.
Please give this latest version of Apama a try and let us know how you get on!