anchor.diff:              [IndexDesc]
       end.
   
  -make_get_env(AppName) ->
  -    fun(Key) ->
  -            case application:get_env(AppName, Key) of
  -                undefined ->
  -                    throw({missing_application_config, {AppName, Key}});
  -                {ok, Value} ->
  -                    Value
  -            end
  +get_env(Key) ->
  +    case application:get_env(chef_index, Key) of
  +        undefined ->
  +            throw({missing_application_config, {chef_index, Key}});
  +        {ok, Value} ->
  +            Value
       end.
  
positive.code: -include_lib("amqp_client/include/amqp_client.hrl").
  
  %% API
  -export([start_link/1]).
  
  %% Supervisor callbacks
  -export([init/1]).
  
negative.code: 
  %% @doc Start the chef_index_sup indicating the application name under which the rabbitmq
  %% config is located.
  start_link() ->
      supervisor:start_link({local, ?SERVER}, ?MODULE, []).
  
  init([]) ->
      error_logger:info_msg("starting chef_index_sup~n", []),
      Children = amqp_child_spec(),
      {ok, {{one_for_one, 60, 10}, Children}}.
  
  amqp_child_spec() ->
      %% Lookup AMQP connection info
      case application:get_env(chef_index, rabbitmq_host) of
          undefined ->
              error_logger:info_msg("RabbitMQ config missing. Indexing for search is disabled.~n"),
              [];
          {ok, Host} ->
              Port = get_env(rabbitmq_port),
              User = get_env(rabbitmq_user),
              Password = get_env(rabbitmq_password),
              VHost = get_env(rabbitmq_vhost),
              ExchgName = get_env(rabbitmq_exchange),
              Exchange = {#'exchange.declare'{exchange=ExchgName, durable=true}},
              Network = {network, Host, Port, {User, Password}, VHost},
              error_logger:info_msg("Connecting to Rabbit at ~s:~p~s (exchange: ~p)~n",
  