Skip to content

Console

Alisha Mohanty edited this page Sep 18, 2024 · 11 revisions

Goose console is a web interface that provides visual representation and control over its job management features.

Currently console supports display of job stats and tweaking enqueued jobs for both brokers.

image

console-opts:

  • route-prefix (string):

    • Specifies the base url path to be used for matching and handling console routes.
    • This base path will be prepended to all console route paths handled by the app-handler function
    • Should not include a trailing slash at the end
    • Example: route-prefix set to "/console", the enqueued endpoint will be accessible at path /console/enqueued
  • broker (map):

    • Broker implementing goose.broker/Broker protocol.
    • Example: (redis/new-producer redis/default-opts)
  • app-name (string):

    • Name to be displayed in Navigation bar of UI.
    • Example: "Goose Console"

Usage

(ns client
  (:require
    [compojure.core :refer [context defroutes]]
    [compojure.route :as route]
    [goose.brokers.redis.broker :as redis]
    [goose.console :as console]
    [ring.adapter.jetty :as jetty]))

(defonce server (atom nil))

(def redis-producer (redis/new-producer redis/default-opts))

(defroutes goose-routes
           (context "/goose" []
                    (partial console/app-handler (assoc console/default-console-opts :broker redis-producer))
           (route/not-found "<h1>Page not found </h1>"))

(defn start-server []
  (reset! server (jetty/run-jetty goose-routes {:port  3000
                                                :join? false})))

(defn stop-server []
  (when-let [s @server]
    (.stop s)
    (println s "Stopped")))

After executing (start-server), check Goose Console at http://localhost:3000/goose/


Previous: Guide to Message Broker Integration        Next: Job Lifecycle

Clone this wiki locally