To run this example your build.gradle
file should contain the following task to execute the pipeline:
task executeCdapSalesforce (type:JavaExec) { mainClass = System.getProperty("mainClass") classpath = sourceSets.main.runtimeClasspath systemProperties System.getProperties() args System.getProperty("exec.args", "").split() }
Gradle ‘executeCdapSalesforce’ task allows to run the pipeline via the following command:
gradle clean executeCdapSalesforce -DmainClass=org.apache.beam.examples.complete.cdap.salesforce.CdapSalesforceToTxt \ -Dexec.args="--<argument>=<value> --<argument>=<value>"
To execute this pipeline, specify the parameters in the following format:
--username=your-user-name\ --password=your-password \ --securityToken=your-token \ --consumerKey=your-key \ --consumerSecret=your-secret \ --loginUrl=your-login-url \ --sObjectName=object-name \ --referenceName=your-reference-name \ --outputTxtFilePathPrefix=your-path-to-output-folder-with-filename-prefix
Please see CDAP Salesforce Batch Source for more information.
Gradle ‘executeCdapSalesforce’ task allows to run the pipeline via the following command:
gradle clean executeCdapSalesforce -DmainClass=org.apache.beam.examples.complete.cdap.salesforce.TxtToCdapSalesforce \ -Dexec.args="--<argument>=<value> --<argument>=<value>"
To execute this pipeline, specify the parameters in the following format:
--username=your-user-name\ --password=your-password \ --securityToken=your-token \ --consumerKey=your-key \ --consumerSecret=your-secret \ --loginUrl=your-login-url \ --sObject=CustomObject__c \ --referenceName=your-reference-name \ --inputTxtFilePath=your-path-to-txt-file \ --operation=Insert \ --errorHandling=Stop on error \ --maxRecordsPerBatch=10 \ --maxBytesPerBatch=9999999 \ --locksDirPath=your-path
Please see CDAP Salesforce Batch Sink for more information.
Gradle ‘executeCdapSalesforce’ task allows to run the pipeline via the following command:
gradle clean executeCdapSalesforce -DmainClass=org.apache.beam.examples.complete.cdap.salesforce.CdapSalesforceStreamingToTxt \ -Dexec.args="--<argument>=<value> --<argument>=<value>"
CdapSalesforceStreamingToTxt
pipeline parameters:
username
- Salesforce username.password
- Salesforce user password.securityToken
- Salesforce security token.consumerKey
- Salesforce connected app's consumer key.consumerSecret
- Salesforce connected app's consumer secret.loginUrl
- Salesforce endpoint to authenticate to. Example: ‘https://MyDomainName.my.salesforce.com/services/oauth2/token’.sObjectName
- Salesforce object to pull supported by CDAP Salesforce Streaming Source.pushTopicName
- name of the push topic that was created from query for some sObject. This push topic should have enabled pushTopicNotifyCreate property. If push topic with such name doesn't exist, then new push topic for provided ‘sObjectName’ will be created automatically.pullFrequencySec
- delay in seconds between polling for new records updates. (Optional)startOffset
- inclusive start offset from which the reading should be started. (Optional)Please see CDAP Salesforce for more information. Also, please see documentation regarding Salesforce streaming API authorization here.
To execute this pipeline, specify the parameters in the following format:
--username=your-user-name\ --password=your-password \ --securityToken=your-token \ --consumerKey=your-key \ --consumerSecret=your-secret \ --loginUrl=your-login-url \ --sObjectName=object-name \ --pushTopicName=your-topic-name \ --pullFrequencySec=100 \ --startOffset=1000