Passare un argomento di runtime a un job di replica
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come passare gli argomenti di runtime nei job di replica di Cloud Data Fusion.
Passare un argomento Debezium a un job di replica
Per passare un argomento da un'applicazione Debezium a un job di replica MySQL o SQL Server in Cloud Data Fusion, specifica un argomento di runtime utilizzando il prefisso source.connector.
Console
Vai all'istanza:
Nella Google Cloud console, vai alla pagina Cloud Data Fusion.
Per aprire l'istanza in Cloud Data Fusion Studio,
fai clic su Istanze e poi su Visualizza istanza.
Individua l'applicazione per il job di replica e fai clic su
buildPreferenze. Si apre la finestra Preferenze.
Nel campo Chiave, specifica un argomento di runtime per il
job di replica anteponendo source.connector.
Fai clic su Salva e chiudi.
API REST
Per impostare un argomento di runtime utilizzando l'API REST, consulta la documentazione di riferimento dei microservizi delle preferenze CDAP.
Configurare i parametri JDBC
Per passare un parametro JDBC a un job di replica MySQL o SQL Server,
specifica l'argomento di runtime con il prefisso source.connector.database.
Ad esempio, per configurare il parametro JDBC sessionVariables su
MAX_EXECUTION_TIME=43200000, imposta un argomento di runtime
con la chiave source.connector.database.sessionVariables e il valore
MAX_EXECUTION_TIME=43200000.
Per configurare più parametri JDBC, imposta un argomento di runtime per ciascun parametro. Ad esempio, per configurare i parametri JDBC
encrypt=true&trustServerCertificate=true, passa i seguenti argomenti:
Chiave
Valore
source.connector.database.encrypt
true
source.connector.database.trustServerCertificate
true
Configura il parametro della chiave principale
La tabella di origine che viene replicata deve avere una chiave primaria. Si tratta di un requisito rigoroso solo quando Oracle è il database di origine. Per le origini SQL Server e MySQL, puoi specificare una chiave primaria personalizzata, anche se la tabella di origine non ne ha una.
Imposta il parametro key con il seguente argomento di runtime:
KEY_COLUMN: la colonna che contiene la chiave sicura.
Puoi impostare la chiave primaria per più tabelle con la proprietà key. L'esempio seguente mostra come impostare la chiave per le tabelle inventory.customers
e purchase.orders:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eRuntime arguments for Cloud Data Fusion replication jobs can be passed using the prefix \u003ccode\u003esource.connector\u003c/code\u003e for Debezium applications.\u003c/p\u003e\n"],["\u003cp\u003eJDBC parameters can be configured for MySQL or SQL Server replication jobs by using the \u003ccode\u003esource.connector.database\u003c/code\u003e prefix in the runtime argument key.\u003c/p\u003e\n"],["\u003cp\u003eIf a source table lacks a primary key (applicable to SQL Server and MySQL), it can be configured by setting the \u003ccode\u003esource.connector.message.key.columns\u003c/code\u003e runtime argument, specifying the schema, table, and key column.\u003c/p\u003e\n"],["\u003cp\u003eThe webpage shows that it is possible to configure the primary key for multiple tables with the \u003ccode\u003ekey\u003c/code\u003e property, as shown in the example with the tables \u003ccode\u003einventory.customers\u003c/code\u003e and \u003ccode\u003epurchase.orders\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a runtime argument using the REST API, by looking at the CDAP Preferences Microservices reference.\u003c/p\u003e\n"]]],[],null,["# Pass a runtime argument to a Replication job\n\nThis page describes how to pass runtime arguments in Cloud Data Fusion\nreplication jobs.\n\nPass a Debezium argument to a replication job\n---------------------------------------------\n\nTo pass an argument from a Debezium application to a MySQL or SQL Server\nreplication job in Cloud Data Fusion, specify a runtime argument using\nthe prefix, `source.connector`. \n\n### Console\n\n1. Go to your instance:\n\n\n 1. In the Google Cloud console, go to the Cloud Data Fusion page.\n\n 2. To open the instance in the Cloud Data Fusion Studio,\n click **Instances** , and then click **View instance**.\n\n [Go to Instances](https://console.cloud.google.com/data-fusion/locations/-/instances)\n\n \u003cbr /\u003e\n\n2. Click menu **Menu \\\u003e\n Control Center**.\n\n3. Locate the **Application** for the replication job and click\n build\n **Preferences** . The **Preferences** window opens.\n\n4. In the **Key** field, specify a runtime argument for the\n replication job by prefixing it with `source.connector`.\n\n5. Click **Save \\& Close**.\n\n### REST API\n\nTo set a runtime argument using the REST API, see the\n[CDAP Preferences Microservices](https://cdap.atlassian.net/wiki/spaces/DOCS/pages/477561058/Preferences+Microservices)\nreference.\n\nConfigure JDBC parameters\n-------------------------\n\nTo pass a JDBC parameter to a MySQL or SQL Server replication job,\nspecify the runtime argument prefixed with `source.connector.database`.\n\nFor example, to configure the JDBC parameter `sessionVariables` to\n`MAX_EXECUTION_TIME=43200000`, [set a runtime argument](/data-fusion/docs/how-to/pass-runtime-args-in-replication#debezium-arguments)\nwith the key `source.connector.database.sessionVariables` and the value\n`MAX_EXECUTION_TIME=43200000`.\n\nTo configure multiple JDBC parameters, set a runtime argument for\neach parameter. For example, to configure the JDBC parameters\n`encrypt=true&trustServerCertificate=true`, pass the following arguments:\n\n| **Note:** Cloud Data Fusion doesn't support setting JDBC arguments during the setup or assessment of a replication job. If you must set JDBC parameters to resolve assessment issues, bypass the assessment by deploying the replication job through the [Replication API](/data-fusion/docs/reference/replication-ref#create-a-replication-job). Then, before you start the job, configure the JDBC arguments as described previously in this section.\n\nConfigure the primary key parameter\n-----------------------------------\n\nThe source table that gets replicated must have a primary key. This is\na strict requirement only when Oracle is the source database. For SQL Server and\nMySQL sources, you can specify a custom primary key, even if the source\ntable doesn't have one.\n\nSet the `key` parameter with the following runtime argument:\n\n`source.connector.message.key.columns = `\u003cvar translate=\"no\"\u003eSCHEMA\u003c/var\u003e`.`\u003cvar translate=\"no\"\u003eTABLE\u003c/var\u003e`:`\u003cvar translate=\"no\"\u003eKEY_COLUMN\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSCHEMA\u003c/var\u003e: The name of the source schema.\n- \u003cvar translate=\"no\"\u003eTABLE\u003c/var\u003e: The source table name.\n- \u003cvar translate=\"no\"\u003eKEY_COLUMN\u003c/var\u003e: The column that contains the secure key.\n\nYou can set the primary key for multiple tables with the `key` property. The\nfollowing example shows how to set the key for the tables `inventory.customers`\nand `purchase.orders`: \n\n source.connector.message.key.columns = inventory.customers:pk1,pk2;purchase.orders:pk3,pk4\n\nConfigure isolation mode for a snapshot in SQL Server replication\n-----------------------------------------------------------------\n\nFor more information about the runtime argument for isolation mode, see\n[Isolation levels in SQL Server replication](/data-fusion/docs/concepts/replication-isolation-levels).\n\nWhat's next\n-----------\n\n- Learn more about [Replication](/data-fusion/docs/concepts/replication) in Cloud Data Fusion.\n- Refer to the [Replication API reference](/data-fusion/docs/reference/replication-ref)."]]