Skip to content

Latest commit

 

History

History
114 lines (67 loc) · 4.35 KB

getting-started.md

File metadata and controls

114 lines (67 loc) · 4.35 KB

Getting Started

This guide will help you to start using Deckard and consists of the following sections:

Understanding Deckard

Deckard is a priority queue that uses gRPC to communicate with its clients.

To learn more about its components please check the components documentation.

To check the available configuration options please check the configuration section.

To learn the structure of this git project and its folders, check the contributing guide.

To learn how to integrate Deckard with your application please check consuming section.

To understand which services are exposed by Deckard and its message and types, please check the documentation of Deckard's protocol buffer definition.

Running Deckard

The fastest way to start using deckard is by using Docker or downloading its binary.

If you want to execute it in a Kubernetes cluster you can use the Helm chart.

Using docker

You can run deckard using docker by using the following command:

docker run --rm -p 8081:8081 blipai/deckard

By default it will use a memory storage and a memory cache engine.

To change the default configuration see the configuration section.

Using Helm

To install the Deckard chart, use the following commands:

helm repo add deckard https://takenet.github.io/deckard/
helm install deckard deckard/deckard

It will deploy a MongoDB for storage and a Redis for cache.

Check the chart values.yaml to see all available configurations.

Using the binary

You can download the latest version of deckard from the releases page or by using the following script:

Linux Bash

wget https://github.com/takenet/deckard/releases/latest/download/deckard-linux-amd64.tar.gz

tar -xzf deckard-linux-amd64.tar.gz

chmod +x deckard-linux-amd64

./deckard-linux-amd64

Windows PowerShell

Invoke-WebRequest -Uri "https://github.com/takenet/deckard/releases/latest/download/deckard-windows-amd64.exe.zip" -OutFile "deckard-windows-amd64.exe.zip"

Expand-Archive -Path "deckard-windows-amd64.exe.zip" -DestinationPath .

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

.\deckard-windows-amd64.exe

Consuming Deckard

Deckard exposes a gRPC service that can be consumed by any gRPC client. You can find a documentation of the exposed service, messages and types here. Deckard contains a single proto file and it is located here.

We suggest the usage of Postman to consume the gRPC service manually. You can follow the steps below to configure Postman to consume the gRPC service:

  1. Install Postman.
  2. Open Postman and click on the New button:

Postman New Button

  1. Select gRPC Request:

Postman gRPC Request

  1. Fill the gRPC Service URL with the address of the Deckard instance and the methods will be disovered automatically using the reflection server:

Postman gRPC Service URL

  1. Select the Add method to add messages and click Generate Example Message. Change the message body if wanted and click Invoke.

Validate fields before sending, Postman may generate negative numbers for int fields.

Also, Postman will not generate valid fields for the payload field. It will generate invalid type_url values. Check the documentation to see how any fields works and how to generate the type_url field.

You have now successfully added messages to the Deckard queue.

Now you can use the Pull method to consume messages and Ack or Nack to acknowledge the message. Remember to use the same queue when using Pull and the same id when using Ack or Nack.

Next Steps

To learn how to configure deckard please check the configuration section.

To learn how to use deckard in your application please check the usage section and enjoy Deckard in your favorite programming language.