Introducing the new Apama Extension for VS Code

Are you a power user of Cumulocity Streaming Analytics? Do you build your own Analytics Builder blocks, EPL apps, or custom Apama microservices and want to enhance your productivity with the popular IDE used by more than 14 million people?

Great news - we’re delighted to announce the Apama Extension for Microsoft Visual Studio Code, available now on the Visual Studio Marketplace.

Tell me more!

The Apama Extension for VS Code is a community-developed extension that will super-charge your local EPL development with features such as completion proposals, problem markers, hovers (displaying ApamaDoc for API calls), and the ability to quickly jump from one part of your code to another.

The great thing about using VS Code is you get to benefit from all the juicy features built into VS Code itself and its rich ecosystem of third party extensions - for example support for languages like Python, C++ and Java (in case you want to build some EPL plug-ins), and the very cool (and constantly improving) “AI pair programming” experience of GitHub Copilot.

… and that’s not all

We’re also introducing a new Sample repository template for Streaming Analytics on GitHub. This is a Git repository with a recommended Apama project layout that is ideal for building analytics blocks and EPL apps. GitHub has a convenient button “Use this template” from which you can easily create your own repository from the template.

How do I get it? Using a “Dev Container”…

There are quite a few different ways you could install Apama and the VS Code extension, but the approach we think provides the easiest experience is doing your Apama development inside a pre-configured Docker container, the so-called Dev Container approach.

This requires making a Git repo with a .devcontainer directory (just copy this from the template repository).

The nice thing is there’s no need to manage your own installation of Apama - all you have to do is ask VS Code to clone from the URL of your (devcontainer-enabled) Git repository, and it will clone your repo (along with the Block SDK and EPL Apps Tools), then pull the latest Apama builder image and give you an environment where you can work on your application inside the Docker container.

But before you can get started (at least for Windows users) you do need to install a couple of pre-requisites on your machine (WSL, and a container engine such as Rancher Desktop). It takes a few minutes, but once that’s out of the way the experience is pretty smooth.

For full details of using Dev Containers see the VS Code documentation, or the quick start summary here.

Oh, and if you want to do some quick EPL work without installing anything at all, or just try it out, you can open any devcontainer-enabled repository in GitHub using GitHub Codespaces from your web browser!

What if I’m using the older Apama 10.15 version?

Most Cumulocity users will be developing for the latest version of Apama, i.e. the Apama used by the cloud version of Streaming Analytics (currently 26.x). However although development of the extension is focused on the latest version, users of the older Apama 10.15 release (for example, for Cumulocity 2025) aren’t left out.

The extension also supports 10.15 (using fix version 10.15.6.4 and later). For 10.15 users, the extension for VS Code is a great alternative to the older Eclipse-based plug-in you may be familiar with, if you want a more modern development experience.

What can the Apama Extension do for me?

Here’s a screenshot showing what the main editing window looks like:

In the screenshot you can see:

  • The “Problems” view at the bottom showing any EPL errors in your code
  • Syntax highlighting of the EPL language on the right
  • The “Outline” view on the left showing the events, monitors and actions in the open editor
  • The “Apama Projects” view (lower left) showing the bundles added to your project, with a “+” button for adding additional bundles to your project

If you want to run your application locally to check it works correctly, our recommendation would be to create testcases using PySys and run them from the “Terminal” tab; the template repository includes some samples to get started. It is also possible to manually run a correlator and inject your application into it (using engine_deploy inject) from the VS Code Terminal window.

When editing a .mon file completion proposals are available after typing a package name or event followed by a . (and ApamaDoc for each item is also shown if you click the “>” expansion icon):

A number of “snippets” allow you to quickly add common EPL constructs such as a new event, monitor, for loop etc just by typing the relevant keyword:

You can also jump to the definition of any event, field or action by holding Ctrl and clicking on it, or pressing Ctrl+T and entering its name.

When hovering over an EPL identifier or calling an action, a tooltip displays helpful information including any /** ApamaDoc */ documentation for the API you’re calling:

We hope you enjoy using these features of the extension!

Questions

The extension uses an Apama installation to implement features of the EPL language, as listed in the product documentation so it is worth rebuilding your Dev Container to use the latest version of Apama to get the latest features. However it’s important to note that the Apama Extension itself is an open-source community-maintained component, and not part of the product suite. We welcome PRs to extend and enhance the open-source extension.

If you have any questions, or want to make a suggestion for improving it further, please add a post to the Streaming Analytics Apama area in the Cumulocity Tech Community.

4 Likes