"use strict";
/**
 * Amqp Publisher
 *
 *  Copyright (C) 2010-2019 R-T Specialty, LLC.
 *
 *  This file is part of liza.
 *
 *  liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Publish Amqp message to a queue
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAmqpConfig = void 0;
/**
 * Create an amqp configuration from the environment
 *
 * @param env - the environment variables
 *
 * @return the amqp configuration
 */
function createAmqpConfig(env) {
    return {
        protocol: 'amqp',
        hostname: env.AMQP_HOST,
        port: +(env.AMQP_PORT || 0),
        username: env.AMQP_USER,
        password: env.AMQP_PASS,
        locale: 'en_US',
        frameMax: +(env.AMQP_FRAMEMAX || 0),
        heartbeat: +(env.AMQP_HEARTBEAT || 0),
        vhost: env.AMQP_VHOST,
        exchange: env.AMQP_EXCHANGE,
        retries: env.AMQP_RETRIES || 30,
        retry_wait: env.AMQP_RETRY_WAIT || 1000,
    };
}
exports.createAmqpConfig = createAmqpConfig;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQW1xcFB1Ymxpc2hlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIkFtcXBQdWJsaXNoZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FxQkc7OztBQU1IOzs7Ozs7R0FNRztBQUNILFNBQWdCLGdCQUFnQixDQUFDLEdBQXNCO0lBQ3JELE9BQW1CO1FBQ2pCLFFBQVEsRUFBRSxNQUFNO1FBQ2hCLFFBQVEsRUFBRSxHQUFHLENBQUMsU0FBUztRQUN2QixJQUFJLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxTQUFTLElBQUksQ0FBQyxDQUFDO1FBQzNCLFFBQVEsRUFBRSxHQUFHLENBQUMsU0FBUztRQUN2QixRQUFRLEVBQUUsR0FBRyxDQUFDLFNBQVM7UUFDdkIsTUFBTSxFQUFFLE9BQU87UUFDZixRQUFRLEVBQUUsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxhQUFhLElBQUksQ0FBQyxDQUFDO1FBQ25DLFNBQVMsRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFDLGNBQWMsSUFBSSxDQUFDLENBQUM7UUFDckMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxVQUFVO1FBQ3JCLFFBQVEsRUFBRSxHQUFHLENBQUMsYUFBYTtRQUMzQixPQUFPLEVBQUUsR0FBRyxDQUFDLFlBQVksSUFBSSxFQUFFO1FBQy9CLFVBQVUsRUFBRSxHQUFHLENBQUMsZUFBZSxJQUFJLElBQUk7S0FDeEMsQ0FBQztBQUNKLENBQUM7QUFmRCw0Q0FlQyJ9