This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nebolintegration_tutorial_2 [2021/08/11 22:33] – nebol | nebolintegration_tutorial_2 [2021/08/11 22:46] (current) – removed nebol | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== So what happened? ==== | ||
- | A continuation of [[NebolIntegration_Tutorial_1]] - Creating your first integration | ||
- | |||
- | [[IntegrationQueue.Status]] | ||
- | |||
- | === Database structure === | ||
- | |||
- | It will be useful to discuss the database structure. Eventually you'll probably need to get in there to do some maintenance so it's important to understand what going on. | ||
- | |||
- | (Click image to show full-size) | ||
- | |||
- | {{: | ||
- | |||
- | * Integration - this table is the main table containing information & settings for each integration | ||
- | * IntegrationQueue - contains submitted requests for integration jobs | ||
- | * IntegrationResult - contains the result(s) of the integration jobs | ||
- | * IntegrationHealthCheck - contains the information & settings for the health checks | ||
- | * IntegrationHealthCheckLog - contains the results of the health checks | ||
- | |||
- | ==== The Flow ==== | ||
- | |||
- | The Integration table has information on the integration such as name, description, | ||
- | |||
- | When the Engine is started it creates a separate thread for every integration. Every integration will be sleeping until it's time do poll the database for new queue items (requests) according to its set polling interval. | ||
- | |||
- | When you do a Submit for an integration, | ||
- | |||
- | It also has a Reference field, which is a string, and it's your parameter that you will use to figure out what to do once the job is to be processed. If the integration is sending user data to another system, the Reference might be a User ID. If the integration is created invoice PDF files, the Reference might be an Invoice ID. That is entirely up to you and how you implement your integration. | ||
- | |||
- | When the integration does a poll, it gathers all the integration jobs from the IntegrationQueue table which are up for an attempt, and processes them, one at a time. If the job was successful, it will update the [[IntegrationQueue.Status]] field to Success. If it failed, it will set it to Error. If the job has been tried too many times, it will be set to GaveUp and stop trying. Either way it will create a record in IntegrationQueueResult. That record will have either information about the failure (error message) or the success (successful response data). | ||
- | |||
- | A few more things to note: NebolIntegration version 1.0.x.x does not support running multiple engines or threads per integration. Version 1.1.x.x will support that, though. |