<commit_before>/**
 * Factory to start the AMQP server and initialize it
 */

var amqpSubs = require('./amqp_subscribers');
var logger = require('../logger');

exports.initialize = function(){
	
	/**
	 * TODO get the configurations from local and 
	 * configure the consumers
	 */
	var isMessagingServerRunning = false;//init this after checking.
									// this is hard-coded
	
	if(isMessagingServerRunning){
		logger.info('MessagingFactory', ' Starting AMQP Messaging server....');
		amqpSubs.startSub();
		logger.info('MessagingFactory', ' AMQP Messaging server Started');
	} else {
		logger.info('MessagingFactory', ' AMQP Messaging server is not running');
	}
	
	
}<commit_msg>import configuration<commit_after>/**
 * Factory to start the AMQP server and initialize it
 */
var amqp = require('amqp');
var amqpSubs = require('./amqp_subscribers');
var logger = require('../logger');
var http = require('http');

var serverConfig = require('../../configuration/server_config').amqp;
var eventSubs = require('../../configuration/event_config').eventSubscribers;
exports.initialize = function(){
	
	/**
	 * TODO get the configurations from local and 
	 * configure the consumers
	 */
	var isMessagingServerRunning = true;//serverConfig.status;
	
	
	if(isMessagingServerRunning === true){
		logger.info('MessagingFactory', ' Starting AMQP Messaging server....');
		
		var connection = amqp.createConnection(serverConfig.server);
		amqpSubs.startSub(connection, eventSubs);
		logger.info('MessagingFactory', ' AMQP Messaging server Started');
	} else {
		logger.info('MessagingFactory', ' AMQP Messaging server is not running');
	}
	
	
}
{'fraction_non_alphanumeric': 0.13683567501527183, 'fraction_numerical': 0.0, 'mean_word_length': 4.318181818181818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7032411', 'n_tokens_mistral': 515, 'n_tokens_neox': 453, 'n_words': 126}