The meaning of Synchronous / Asynchronous in prpcServiceUtils

Hi,

Can someone give some details about Synchronous / Asynchronous when using prpcServiceUtils import & export? Below is the information from Help.

Question #1: Is Kafka Stream service related here? My guess is, Asynchronous uses Kafka and Synchronous does not use Kafka. Am I right?

Question #2: The default of prpcServiceUtils mode is Asynchronous. But in this case we need to run one more additional getStatus operation, that is cumbersome. Why is Asynchronous the default? I think Synchronous is one operation and quick, so shouldn’t Synchronous be the default?

@CloeW938 The Synchronous / Asynchronous option in prpcServiceUtils uses the queueBatchActivity() method to spawn a parallel requestor for the export and import activity.

So to your questions , for question 1 it’s just a parallel requestor not a stream service .

and to question #2 I guess sync and async both have their advantages and disadvantages , async provides a non blocking mode of execution so if the export takes a long time then the calling process is not blocked but as you indicated on the flip side you need to make another call to get the status.

If you are interested have a look at the activity pzExportServiceJSONWrapper this is what is called internally by prpcServiceUtils for export operation

@KAUSTAV.DUTTA

Thank you for the info. For #2, please allow me to confirm below:

  • Asynchronous (default): The product file is not downloaded by export command itself and you still need to retrieve job status by getStatus command. Initially I thought getStatus is only for checking status but actually file is not created unless you check the status (I am feeling this is not a intuitive specification..).
  • Synchronous: The product file is downloaded only by export command. No need to retrieve status for actual file creation.

Is my observation correct? Do people take two steps (export and getStatus) to export a product file? Is that the standard process?

Thanks,

@CloeW938 in both modes the product file is created

For synchronous the file is created synchronously and the response contains the path to the file.

For async the getStatus command needs to be called and that will contain the path to the file once the async job completes.