(config, logger)
Get the queue manager connection
Get the queue manager connection
Get the queue manager connection
def get_queue_manager_connection(config, logger):
    # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager
    """
    Get the queue manager connection
    """
    if config.ssl:
        # There is a memory leak when SSL connections fail.
        # By testing with a normal connection first, we avoid making unnecessary SSL connections.
        # This does not fix the memory leak but mitigate its likelihood.
        # Details: https://github.com/dsuch/pymqi/issues/208
        try:
            get_normal_connection(config, logger)
        except pymqi.MQMIError as e:
            logger.debug("Tried normal connection before SSL connection. It failed with: %s", e)
            if e.reason == pymqi.CMQC.MQRC_UNKNOWN_CHANNEL_NAME:
                raise
        return get_ssl_connection(config, logger)
    else:
        return get_normal_connection(config, logger)
def get_queue_manager_connection ( config , logger ) : # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager if config . ssl : # There is a memory leak when SSL connections fail. # By testing with a normal connection first, we avoid making unnecessary SSL connections. # This does not fix the memory leak but mitigate its likelihood. # Details: https://github.com/dsuch/pymqi/issues/208 try : get_normal_connection ( config , logger ) except pymqi . MQMIError as e : logger . debug ( "Tried normal connection before SSL connection. It failed with: %s" , e ) if e . reason == pymqi . CMQC . MQRC_UNKNOWN_CHANNEL_NAME : raise return get_ssl_connection ( config , logger ) else : return get_normal_connection ( config , logger )