So I am new to the Bulk API provided by Salesforce and I was going through their developers guide. I have few questions that need some clarification:

  1. Bulk API Query part of the guide says that one can retrieve a batch of 1GB at once and one can retrieve 15 such batches. However, I also read that there is a batch size limitation of 10,000 records. Does this apply to Bulk Query also?
  2. I went through the sample java bulk query code. And the part where the code says: for(int i=0; i<10000; i++) { Thread.sleep(i==0 ? 30 * 1000 : 30 * 1000); //30 sec . . . Many developers have explained that this 10,000 value is being used to set the batch size but I don't get it how is it being used to set the batch size. From my understanding it is just for the number of retries to check if the batch is completed. URL for code location in developer guide: https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_using_bulk_query.htm
  3. How does creating a job determines number of batches that need to be created to retrieve all the data. Is it handled automatically? Or do we need write some code to do that?
  4. Is there a proper code sample available so that I can go through that and understand things.
  5. How do I use the PK chunking header in Java code?

Thanks, Prateek

1 Answer 1

  1. This link may help: https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_concepts_limits.htm

  2. When creating a job, salesforce internally decides the number of batches to be created to cover all the data. No need to write code for that.

  • Thanks Anita for your response. Also, can you tell me if batches are decided by salesforce then how can I know how to retreive them? Does the batch id remains same and does it contain multiple result ids for multiple batches? Because the code on Salesforce website handles multiple result ids. It only creates one batch using createBatchFromStream() method. Commented Mar 25, 2015 at 17:11
  • @Prateek sorry for the delay. Please refer below link, it might help you. developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/… Commented Jun 3, 2016 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .