{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21198,"path":"integrate-applications/integration-hub/dsa-on-mid.md","title":"MID Server support for Data Stream actions","bundle":null,"doc_type":null,"release":"australia","body":"\n# MID Server support for Data Stream actions\n\nGet data through a ServiceNow® MID Server when running a Data Stream action.\n\nWhen selected, the MID Server retrieves the data and sends each page to the instance as an attachment to process.\n\n**Important:** When running the Data Stream action within flow, the actions in the **For Each** block always run on the instance.\n\nThese steps can run on either the MID Server or the instance:\n\n-   Action Preprocessing Script\n-   Request Script step\n-   REST or SOAP step\n\n**Note:** Avoid shifting the execution environment between the instance and the MID Server multiple times. For example, you might configure the Request Script step to run on the MID Server, but the REST step to run on the instance. In this case, the system shifts environments between the instance and MID Server for every page of data, which may degrade performance.\n\nTo learn more about running a step on a MID Server, see [Integration steps](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/integration-steps.md).\n\n## Size limits\n\nIf your system encounters a timeout or size limit issue, try making one of these adjustments:\n\n-   **Increase the REST transaction quota rule**\n\n    If the connection between the instance and the MID Server slows down, you may encounter a timeout while waiting for a response from the REST step. Increase the default timeout by updating the **REST Attachment API request timeout** transaction quota rule.\n\n    -   Default: 60 seconds\n    -   Maximum: 300 seconds\n-   **Increase the instance timeout**\n\n    By default, the instance waits for 600 seconds to retrieve a single page of data from a MID Server. If you encounter a timeout when running a Data Stream action through a MID Server, change this default by increasing the **datastream\\_alternative\\_env\\_fetch\\_page\\_timeout\\_seconds** system property.\n\n    -   Default: 600 seconds\n    -   Maximum: 7200 seconds\n-   **Increase attachment size**\n\n    The MID Server sends each page of data to the instance as an attachment. If a page of data is large, it may exceed the allowed attachment size. Increase the allowed size by updating the **com.glide.attachment.max\\_size** system property.\n\n    -   Default: 1024 MB\n    -   Maximum: None\n\n## JDBC operations and MID Server timeouts\n\nFor JDBC operations, execute the Data Stream Action asynchronously and poll the Attachments \\[sys\\_attachment\\] table for results.\n\nThe MID Server processes the SQL statement, while the instance/main thread waits for context payloads to be inserted into the attachment table to query the next record.\n\nYou can adjust timeout values for JDBC operations with the following properties.\n\n-   **__com.snc.process\\_flow.datastream.payload.timeout.seconds__**\n\n    The amount of time the instance waits for the payload to be available from the JDBC execution in the MID Server. A bounded property with a minimum value of 0 seconds and a maximum value of 7200 seconds. The default time is 600 seconds.\n\n-   **__com.snc.process\\_flow.datastream.async\\_child.timeout.seconds__**\n\n    The amount of time allocated for the execution of a child plan in the MID Server.A bounded property with a minimum value of 0 seconds and a maximum value of 7200 seconds. The default time is 60 seconds.\n\n\n**Parent Topic:**[Data Stream actions and pagination](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/integration-hub/data-stream-actions.md)\n\n"}}