Duplicate items in Queue

Recently I had an interview , I faced this kind of questions. Please provide any solution regarding that.

Suppose 50 items got added in Queue and once processed they are deleted or failed. Now if the dispatcher process is Re-executed how can we avoid duplicate records?

Suppose a dispatcher process runs at 7am in the morning and add few queue items. The same dispatcher also runs every two hours. Now how can we avoid the same addition of similar data on the same day but add that data again at 7am the next day. How can we achieve this?

Suppose 60 items are added to the queue and 12 transaction items got processed successfully but rest got failed. Now when the dispatcher process is re-executed to add items in the queue then how can we avoid addition of those successfully processed items again?

How we can check if similar items exists in queue without unique reference property? How we can avoid addition of similar data to queue irrespective of status

1 Like

Please put a condition whenever its process filter the queue with failed or empty records

So whenever the transaction item runs it filters the queue item by failed or empty

I assume these queueitems have some unique data, possible in the SpecificContent. Then you could possible achieve this by getting the QueueItems via the Orchestrator HTTP Request-activity.
We have a setup where some of our queueitems are processed in batches. We keep track of them by assigning a unique id to a group of items. But this would work with any distint data.

Eksampel:
This queueitem was one of many successful transactions, but the only item with this specificcontent-value / in this batch.

So we are able to query this specific item without using a queue with unique-reference.
We query the items via the API:

GET /odata/QueueItems?$filter=Status eq 'Successful' And Contains(SpecificData,'e66cc6ea-e86e-4b16-9f91-79687fa0e4b4')

{
  "@odata.context": "https://{OrchestratorInstance}/odata/$metadata#QueueItems",
  "@odata.count": 1,
  "value": [
    {
      "QueueDefinitionId": 245,
      "Encrypted": false,
      "OutputData": "{\"DynamicProperties\":{\"key\":\"value\"}}",
      "AnalyticsData": null,
      "Status": "Successful",
      "ReviewStatus": "None",
      "ReviewerUserId": null,
      "Key": "7b1d62ed-547f-4be5-945f-e06ef7854170",
      "Reference": null,
      "ProcessingExceptionType": null,
      "DueDate": null,
      "RiskSlaDate": null,
      "Priority": "Normal",
      "DeferDate": null,
      "StartProcessing": "2022-01-18T11:59:49.007Z",
      "EndProcessing": "2022-01-18T11:59:49.45Z",
      "SecondsInPreviousAttempts": 0,
      "AncestorId": null,
      "RetryNumber": 0,
      "SpecificData": "{\"DynamicProperties\":{\"Gyldigheds-dato\":\"2021-01-05\",\"MĂĄlepunkts ID\":\"11\",\"MĂĄlepunkt type\":\"D14\",\"Tilslutnings-status\":\"E22\",\"Parents mĂĄlepunkts ID\":\"571313191191432568\",\"BatchID\":\"e66cc6ea-e86e-4b16-9f91-79687fa0e4b4\"}}",
      "CreationTime": "2022-01-13T17:04:58.27Z",
      "Progress": null,
      "RowVersion": "AAAAAAAaIBc=",
      "OrganizationUnitId": 129,
      "OrganizationUnitFullyQualifiedName": "Default",
      "Id": 940900,
      "ProcessingException": null,
      "SpecificContent": {
        "Gyldigheds-dato": "2021-01-05",
        "MĂĄlepunkts ID": "11",
        "MĂĄlepunkt type": "D14",
        "Tilslutnings-status": "E22",
        "Parents mĂĄlepunkts ID": "571313191191432568",
        "BatchID": "e66cc6ea-e86e-4b16-9f91-79687fa0e4b4"
      },
      "Output": {
        "key": "value"
      },
      "Analytics": null
    }
  ]
}

Hi @Akshay_Mishra ,
When adding items to queue add a proper reference for the queue items.
When running the dispatcher, before adding items to queue ,use get queue items activity use filter there-status as successful.
And add queue items which is not included in the output of Get Queue Items activity.

1 Like