rabbitmq-tutorials/common-lisp/emit-log-direct.lisp
2016-03-02 04:57:43 -08:00

19 lines
440 B
Bash
Executable File

#!/bin/sh
sbcl --noinform --noprint $@ <<EOF
(ql:quickload :cl-bunny.examples)
(in-package :cl-bunny.examples)
(with-connection ()
(with-channel ()
(let* ((args (rest sb-ext:*posix-argv*))
(severity (or (first args) "info"))
(msg (format nil "~{~a~^ ~}" (rest args)))
(x (exchange.direct "direct_logs")))
(publish x msg :routing-key severity)
(format t " [x] Sent '~a'~%" msg))))
EOF