def METHOD_NAME(component_name, config):
    socket_path = os.path.join(WAZUH_PATH, 'queue', 'sockets')
    dest_socket = os.path.join(socket_path, component_name)
    command = f"getconfig {config}"
    # Socket connection
    s = SocketController(dest_socket)
    try:
        # Send message
        s.send(command.encode(), True)
        # Receive response
        rec_msg_ok, rec_msg = s.receive(True).decode().split(" ", 1)
    except socket.timeout as error:
        s.close()
        raise TimeoutError(error)
    try:
        if rec_msg_ok.startswith('ok'):
            remote_configuration = json.loads(rec_msg)
            for element in remote_configuration['wmodules']:
                if 'gcp-pubsub' in element:
                    remote_configuration_gcp = element['gcp-pubsub']
        else:
            s.close()
            raise ValueError(rec_msg_ok)
    except UnboundLocalError as error:
        s.close()
        raise TimeoutError(error)
    return remote_configuration_gcp