Use an existing RabbitMQ installation

Follow this process if you wish to use an existing RabbitMQ server with TeamForge EventQ.

This article provides alternate installation instructions if you wish to use an existing RabbitMQ server with TeamForge EventQ. Follow the installation instructions in EventQ installation walk-through until it refers you to this article. After following instructions here, continue with the configuration section.
Important: While, TeamForge EventQ 17.1 supports RabbitMQ 3.6.2, you can run it with RabbitMQ 3.3.1 (or later) as well.
  1. Install RabbitMQ or use an existing installation
    > Do you have an existing RabbitMQ system you would like to use? [No]:

    The following steps assume you answer "Yes". If your answer is "No", skip these steps and refer to the primary installation guide: EventQ installation walk-through.

  2. Provide a RabbitMQ hostname
    > What is your RabbitMQ host [localhost]:

    Enter the hostname of your existing RabbitMQ server.

  3. Provide a RabbitMQ port number
    > What port is RabbitMQ running on [5672]:

    Enter the port being used by your existing RabbitMQ server. The default here is the standard port used by RabbitMQ.

  4. Provide a RabbitMQ vhost
    > What is your RabbitMQ vhost [/]:

    Enter the desired vhost on your existing RabbitMQ server. The default here is the standard vhost used by RabbitMQ.

  5. Provide a RabbitMQ username for use by EventQ to communicate with adapters:
    > Provide a RabbitMQ username EventQ should use to communicate with adapters [guest]:

    Enter the RabbitMQ username that EventQ should use to read and write information to and from EventQ related queues.

    To setup a new RabbitMQ user with proper permissions:

    sudo PATH_TO_RABBIT_CTL/rabbitmqctl add_user USERNAME PASSWORD sudo PATH_TO_RABBIT_CTL/rabbitmqctl set_permissions -p VHOST USERNAME "^eventq.*" "^eventq.*|amq.default" "^eventq.*|amq.default"

    where PATH_TO_RABBIT_CTL , VHOST, USERNAME and PASSWORD should be replaced by your actual values.

  6. Provide associated RabbitMQ password
    > What is the password for this user? [guest]:

    Enter the password for the user specified in the previous installer question.

  7. Provide a RabbitMQ username with permission to create new users with write access
    > Provide a RabbitMQ username that has permission to create new RabbitMQ users with write access to EventQ queues:

    Supply a username that has permissions to create new users that have write access to EventQ queues. When creating data sources, TeamForge EventQ creates RabbitMQ users that have permissions to put data onto EventQ related queues. Creating RabbitMQ credentials on demand simplifies the process of disseminating queue credentials to users setting up adapters.

    To setup a new RabbitMQ user with proper permissions:

    sudo PATH_TO_RABBIT_CTL/rabbitmqctl add_user USERNAME PASSWORD sudo PATH_TO_RABBIT_CTL/rabbitmqctl set_user_tags USERNAME administrator

    where PATH_TO_RABBIT_CTL , VHOST, USERNAME and PASSWORD should be replaced by your actual values.

  8. Provide associated RabbitMQ password
    > What is the password for this user?:

    Enter the password for the user specified in the previous installer question.

  9. As you are using an existing RabbitMQ server (which must be RabbitMQ 3.3.1 or later), you must create (or update) the rabbitmq.config file.
    Refer to the following rabbitmq.config file and
    • create the rabbitmq.config file at ${install_prefix}/etc/rabbitmq/ directory.
    • update (merge) the rabbitmq.config file in case you have one already at ${install_prefix}/etc/rabbitmq/ directory.
    [{rabbit, [{loopback_users, []}]},
     {rabbitmq_shovel,
      [{shovels,
        [%% A named shovel worker.
          {'static.eventq.commits',
           [
            {sources,
             [%% URI(s) and pre-declarations for all source broker(s).
              {brokers, ["amqp://"]},
              {declarations, [ {'queue.declare', [{queue, <<"orchestrate.commits">>}, durable]},
                                                  {'exchange.declare', [ {exchange, <<"event.hub">>}, 
                                                                         {type, <<"topic">>}, durable ]}, 
                                                  {'queue.bind', [ {exchange, <<"event.hub">>}, 
                                                                   {queue, <<"orchestrate.commits">>}, 
                                                                   {routing_key, <<"orchestrate.commits">>} ]} ]}
             ]},
            {destinations,
             [%% A singular version of the 'brokers' element.
              {broker, "amqp://"},
              {declarations, [{'exchange.declare', [ {exchange, <<"event.hub">> }, {type, <<"topic">>}, durable ] }
                             ]
              }
            ]
          },
          {queue, <<"orchestrate.commits">>},
          {publish_fields, [{exchange,    <<"event.hub">>},
                            {routing_key, <<"eventq.commits">>}]}
          ]} %% End of static.eventq.commits
          
          ,{'static.eventq.custom',
           [
            {sources,
             [%% URI(s) and pre-declarations for all source broker(s).
              {brokers, ["amqp://"]},
              {declarations, [ {'queue.declare', [{queue, <<"orchestrate.custom">>}, durable]},
                                                  {'exchange.declare', [ {exchange, <<"event.hub">>}, 
                                                                         {type, <<"topic">>}, durable ]}, 
                                                  {'queue.bind', [ {exchange, <<"event.hub">>}, 
                                                                   {queue, <<"orchestrate.custom">>}, 
                                                                   {routing_key, <<"orchestrate.custom">>} ]} ]}
             ]},
            {destinations,
             [%% A singular version of the 'brokers' element.
              {broker, "amqp://"},
              {declarations, [{'exchange.declare', [ {exchange, <<"event.hub">> }, {type, <<"topic">>}, durable ] }
                             ]
              }
            ]
          },
          {queue, <<"orchestrate.custom">>},
          {publish_fields, [{exchange,    <<"event.hub">>},
                            {routing_key, <<"eventq.custom">>}]}
          ]} %% End of static.eventq.custom
          
          ,{'static.eventq.reviews',
           [
            {sources,
             [%% URI(s) and pre-declarations for all source broker(s).
              {brokers, ["amqp://"]},
              {declarations, [ {'queue.declare', [{queue, <<"orchestrate.reviews">>}, durable]},
                                                  {'exchange.declare', [ {exchange, <<"event.hub">>}, 
                                                                         {type, <<"topic">>}, durable ]}, 
                                                  {'queue.bind', [ {exchange, <<"event.hub">>}, 
                                                                   {queue, <<"orchestrate.reviews">>}, 
                                                                   {routing_key, <<"orchestrate.reviews">>} ]} ]}
             ]},
            {destinations,
             [%% A singular version of the 'brokers' element.
              {broker, "amqp://"},
              {declarations, [{'exchange.declare', [ {exchange, <<"event.hub">> }, {type, <<"topic">>}, durable ] }
                             ]
              }
            ]
          },
          {queue, <<"orchestrate.reviews">>},
          {publish_fields, [{exchange,    <<"event.hub">>},
                            {routing_key, <<"eventq.reviews">>}]}
          ]} %% End of static.eventq.reviews
    
          ,{'static.eventq.builds',
           [
            {sources,
             [%% URI(s) and pre-declarations for all source broker(s).
              {brokers, ["amqp://"]},
              {declarations, [ {'queue.declare', [{queue, <<"orchestrate.builds">>}, durable]},
                                                  {'exchange.declare', [ {exchange, <<"event.hub">>}, 
                                                                         {type, <<"topic">>}, durable ]}, 
                                                  {'queue.bind', [ {exchange, <<"event.hub">>}, 
                                                                   {queue, <<"orchestrate.builds">>}, 
                                                                   {routing_key, <<"orchestrate.builds">>} ]} ]}
             ]},
            {destinations,
             [%% A singular version of the 'brokers' element.
              {broker, "amqp://"},
              {declarations, [{'exchange.declare', [ {exchange, <<"event.hub">> }, {type, <<"topic">>}, durable ] }
                             ]
              }
            ]
          },
          {queue, <<"orchestrate.builds">>},
          {publish_fields, [{exchange,    <<"event.hub">>},
                            {routing_key, <<"eventq.builds">>}]}
          ]} %% End of static.eventq.builds
    
          ,{'static.eventq.work_items',
           [
            {sources,
             [%% URI(s) and pre-declarations for all source broker(s).
              {brokers, ["amqp://"]},
              {declarations, [ {'queue.declare', [{queue, <<"orchestrate.work_items">>}, durable]},
                                                  {'exchange.declare', [ {exchange, <<"event.hub">>}, 
                                                                         {type, <<"topic">>}, durable ]}, 
                                                  {'queue.bind', [ {exchange, <<"event.hub">>}, 
                                                                   {queue, <<"orchestrate.work_items">>}, 
                                                                   {routing_key, <<"orchestrate.work_items">>} ]} ]}
             ]},
            {destinations,
             [%% A singular version of the 'brokers' element.
              {broker, "amqp://"},
              {declarations, [{'exchange.declare', [ {exchange, <<"event.hub">> }, {type, <<"topic">>}, durable ] }
                             ]
              }
            ]
          },
          {queue, <<"orchestrate.work_items">>},
          {publish_fields, [{exchange,    <<"event.hub">>},
                            {routing_key, <<"eventq.work_items">>}]}
          ]} %% End of static.eventq.work_items
    
    
    
        ]}
       %% Rather than specifying some values per-shovel, you can specify
       %% them for all shovels here.
       %%
        ,{defaults, [{prefetch_count,     0},
                    {ack_mode,           on_confirm},
                    {publish_fields,     []},
                    {publish_properties, [{delivery_mode, 2}]},
                    {reconnect_delay,    2.5}]}
      ]}
    ].
Continue with EventQ installation walk-through, picking up with the configuration section.