I would like a review for this connection to RabbitMQ. I just developed it and seems to be working well, but I would like another set of eyes on it before putting this on the sever.package modelsimport com.rabbitmq.client.Connectionimport com.rabbitmq.client.ConnectionFactoryimport com.rabbitmq.client.ConnectionFactoryimport com.rabbitmq.client.MessagePropertiesimport anorm.SQLimport anorm.sqlToSimpleimport anorm.toParameterValueimport play.api.Play.currentobject RabbitMQConnection {  private var connection: Connection = null  def getConnection(ss:Connection): Connection = {    println(ss+  connection <<<<<<<<<<<<<<<<<<<<<<<<)    connection=ss    connection match {      case null => {        val factory = new ConnectionFactory()        println(waiting for new connection)        factory.setHost(172.22.22.222)        println(host setted)        connection = factory.newConnection()        println(connection created)        connection      }      case _ =>{        println(connection is not null)        connection      }    }  }}object RMQ {  var connection = RabbitMQConnection.getConnection(null)  def setQ(qName: String, message: String) = {    println(ping received)    try {      println(connection)      if (connection != null) {        if (connection.isOpen()) {          println(connection is open)        } else {          connection = RabbitMQConnection.getConnection(null)          println(connection is new +connection)        }        println(connetion is ready to use)        val channel = connection.createChannel()        channel.queueDeclare(qName, true, false, false, null) //suggestion         channel.basicPublish(, qName, MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes())        println(status + channel.close())        println(setQ complete executed for  + qName)        Map(result -> success)      } else {        println(connection can't established to rabbit mq for => + qName)        LogFile.QLogs(qName, message)        Map(result -> error)      }    } catch {      case e: Exception =>        println(e.printStackTrace())        println(Rabbit Mq Server is Down for => + qName)        LogFile.QLogs(qName, message)        Map(result ->error)    }  }}
Connecting to RabbitMQ
scala;connection pool;rabbitmq