Start using a Backbeat Server - groupon/backbeat GitHub Wiki

Start Using Backbeat Server

Backbeat uses a push method for delivering jobs to the client. It does this through HTTP. This means client applications need to define an api endpoint for receiving activities from Backbeat.

You need to define two endpoints in your client application.

  1. Receiving activities to run.i.e. http://application-ip/activity
  2. Receiving notifications/errors. i.e. http://application-ip/notifications

Create a Backbeat User

You need to create a user in your Backbeat Server database defining the specific endpoints for backbeat to call. In backbeat console - bundle exec rake console

irb> user = User.create!(activity_endpoint: "http://application-ip/activity", notification_endpoint: "http://application-ip/notifications")
D, [2015-10-06T19:17:09.040000 #22833] DEBUG -- :   SQL (4.0ms)  INSERT INTO "users" ("activity_endpoint", "notification_endpoint") VALUES ('http://application-ip/activity', 'http://application-ip/notifications') RETURNING "id"
 => #<Backbeat::User id: "6e9ca6da-4f54-421f-adb4-44c8165c7b49", decision_endpoint: nil, activity_endpoint: "http://application-ip/activity", notification_endpoint: "http://application-ip/notifications">
 => "6e9ca6da-4f54-421f-adb4-44c8165c7b49"

The user id returned after creating your use is your client application's auth token for interacting with the backbeat server api. It is also how Backbeat namespaces your workflows so that multiple clients can run on the same backbeat instance and so backbeat knows which client to send an activity to.

Interact with backbeat from your application

You can start interacting with your existing backbeat server with one of our existing client libraries. Explanations on how to use the code as well as sample projects are included in their ReadMe.

Write Your Own

Implement your own client for interacting with a Backbeat Server in any language by using the api documentation.