User Tools

Site Tools


Sidebar

Nebol Software Projects:

.NET Class Libraries

Contact info:

johan@nebol.se

nebolintegration_database_and_flow

NebolIntegration: Database and Flow - So what happened?

A continuation of NebolIntegration_Tutorial_1 - Creating your first integration

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, a “technical” name which serves as a unique identifier, a retry scheme that determines how failed attempts will be re-tried, status, direction (incoming or outgoing), seconds between each polling etc.

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, a row will be added to the IntegrationQueue table. It will have the timestamp for when it was submitted, the timestamp of when it was last attempted, how many times it's been trying, the timestamp of when it successed, status etc.

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).

Next: NebolIntegration_HealthChecks - What are HealthChecks and why do we need them?

nebolintegration_database_and_flow.txt · Last modified: 2021/08/11 22:47 by nebol