Installation

Iinital RabbitMQ Setup

Installation of RabbitMQ

Install RabbitMQ by adding the repo to apt sources.

  • Install RabbitMQ signing key
    sudo apt-key adv --keyserver "hkps.pool.sks-keyservers.net" --recv-keys "0x6B73A36E6026DFCA"
  • Install apt HTTPS transport
    sudo apt-get install apt-transport-https
  • Add Bintray repositories that provision latest RabbitMQ and Erlang 21.x releases
    sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF
    deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang-21.x
    deb https://dl.bintray.com/rabbitmq/debian bionic main
    EOF
  • Update package indices
    sudo apt-get update -y
  • Install rabbitmq-server and its dependencies
    sudo apt-get install rabbitmq-server -y --fix-missing

Configuration of RabbitMQ

  • Enable required plugins
    rabbitmq-plugins enable rabbitmq_auth_backend_http
    rabbitmq-plugins enable rabbitmq_management
    rabbitmq-plugins enable rabbitmq_web_stomp
  • Create the configuration file
    cat > /etc/rabbitmq/rabbitmq.config
    [
    {rabbit, [{auth_backends, [rabbit_auth_backend_http, rabbit_auth_backend_internal]},
            {loopback_users, []}]} ,
    {rabbitmq_auth_backend_http,
     [{http_method,   post},
      {user_path,     "http://localhost:8062/api/v1/verify_user"},
      {vhost_path,    "http://localhost:8062/api/v1/verify_vhost"},
      {resource_path, "http://localhost:8062/api/v1/verify_resource"},
      {topic_path,    "http://localhost:8062/api/v1/verify_topic"}]
    }
    ].
  • Create a new admin user. This admin user can be used to remotely login to the RabbitMQ Web-Interface.
    rabbitmqctl add_user sbcsadmin F9GTj30ZNY1sQgZg66qPn02ZxnFWuJxUQGH9
    rabbitmqctl set_user_tags sbcsadmin administrator
    rabbitmqctl set_permissions sbcsadmin ".*" ".*" ".*"
  • Create a new faw user. This user will be used by the Forms and Workflows Service.
    rabbitmqctl add_user sbcsfaw HpQM7WS4bnxBTUhnPJFdq9xk72AtTm5FVZsB
    rabbitmqctl set_permissions sbcsfaw "" "sbcs.*" "sbcs.*"
  • Restart RabbitMQ. Web interface is available at smart-bcs:15672
    systemctl restart rabbitmq-server