REST Service

An application that will expose the REST endpoints needs one of the provided implementations by MicroStream or you need to implement the provided interfaces. In this example, we will use the Spark implementation that MicroStream provides.

Just add the dependency to your project, the logger is optional.


Now use the resolver to connect the REST service to the storage, start it, and you’re good to go.

EmbeddedStorageManager storage = EmbeddedStorage.start();
if (storage.root() == null)
   storage.setRoot(new Object[] {,
      X.List("a", "b", "c"),

// create the REST service
StorageRestService service = StorageRestServiceResolver.resolve(storage);

// and start it

That’s all you have to do to open the REST endpoints to access the stored data.

The base URL of the provided endpoints is per default: http://localhost:4567/microstream/ and you can find out all available endpoints on the root http://localhost:4567


If you want to change the default port (4567) or instance name (microstream) it can be done by using the rest service implementation directly, and not go through the _Resolver` as in the previous snippet.

The Spark service can then be customized to your liking.

StorageRestServiceSparkJava service = StorageRestServiceSparkJava.New(storage);

This will change the base URL to http://localhost/my-name/