Skip to main content

AMPS spark CLI

Interacting with AMPS Using AMPS spark CLI​

AMPS provides the AMPS spark CLI as a command line interface to interacting with an AMPS server. AMPS spark CLI provides many of the capabilities of the AMPS client libraries through this interface. The utility lets you execute AMPS commands from the command line. AMPS spark CLI is a Java application, and requires Java runtime environment version 8 or later on the system.

AMPS spark CLI is most commonly used for ad hoc testing or simple maintenance tasks. For more complicated tasks or more sophisticated maintenance, 60East recommends using one of the client libraries (such as the AMPS Python Client).

To test AMPS spark CLI with the sample configuration, run the following command:

$ $AMPSDIR/bin/spark ping -server localhost:9007 -type json

This command tests connectivity to the AMPS server running at port 9007 on the local system. It confirms that the server is listening on that port using the default protocol for AMPS and accepts JSON messages on that port. The command should produce output like the following:

Successfully connected to tcp://username@localhost:9007/amps/json

You can read more about AMPS spark CLI and other useful tools for troubleshooting AMPS in the Utilities chapter of the AMPS User Guide.

info

It's important to keep in mind that AMPS spark CLI only provides basic functionality -- that is, operations that don't require any particular application logic or special handling. This guide uses AMPS spark CLI for examples where possible, but some features of AMPS (for example, setting certain headers on messages published to AMPS) are only available through the AMPS client libraries.