The Lens Command Webservice provides the HTTP endpoint for commands in the CQRS architecture of Lens
1.5K
The Lens Command Webservice provides the HTTP endpoint for commands in the CQRS architecture of Lens. It does the following:
A command is a tuple of command name and params or a triple of name, id and params. The command name is a keyword. The id is an UUID. Params are a map.
[:create-user {:name "John Doe"}]
[:create-user #uuid "612db307-6a67-4945-8823-238950130bde" {:name "John Doe"}]
Commands without an id, get an id attached. The advantage of sending a command with id is that the command becomes idempotent.
Commands can reference attachments which can be files or arbitrary binary blobs. Referencing attachments is done by symbols in the param map.
[:create-user {:name "John Doe" :image image1}]
There are two command endpoints:
This endpoint allows normal command without attachments. The batch command endpoint supports attachments. The command is encoded in the body of a POST request. The encoding is done with Transit.
The batch command endpoint is reachable under /command.
The batch command endpoint supports attachments. POST requests with attachments have to use multipart form data. The command is encoded in the command field. Attachments are in field named after the references in the command.
The batch command endpoint is reachable under /batch-command.
FIXME
Copyright © 2016 Alexander Kiel
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Content type
Image
Digest
Size
253.3 MB
Last updated
almost 10 years ago
docker pull akiel/lens-ws-cmd