Skip to content

Purge Queue Messages

Vrinda edited this page Mar 27, 2023 · 1 revision

Overview

One can choose to auto delete COMPLETED, FAILED, WARNING and CANCELED queue messages from database based on configurable delays for one or more Queue(s).

Configuration

Using Archive UI

  • Go to Menu->Configuration, then on Devices page, Edit the dcm4chee-arc device. Go to Extensions and Edit extension of Device Extension. Again go to its Extensions and Edit extension of Archive device.
  • Add values for field Purge Queue Messages Polling Interval and Save.
  • Next go to the Child Objects of archive device and select Queue to add Delay for purging completed queue messages, Delay for purging failed queue messages, Delay for purging warning queue messages and Delay for purging canceled queue messages and Save.
  • This can be repeated for other Queue as required.

Using LDAP

One may either

  • create a LDIF file (e.g.):

      version: 1
      dn: dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeQueueMessagePollingInterval
      dcmPurgeQueueMessagePollingInterval: PT1H
      -
      
      dn: dcmQueueName=Export1,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeQueueMessageCompletedDelay
      dcmPurgeQueueMessageCompletedDelay: P1D
      -
      
      dn: dcmQueueName=Export1,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeQueueMessageFailedDelay
      dcmPurgeQueueMessageCompletedDelay: P1D
      -
      
      dn: dcmQueueName=Export1,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeQueueMessageWarningDelay
      dcmPurgeQueueMessageCompletedDelay: P1D
      -
              
      dn: dcmQueueName=Export1,dicomDeviceName=dcm4chee-arc,cn=Devices,cn=DICOM Configuration,dc=dcm4che,dc=org
      changetype: modify
      add: dcmPurgeQueueMessageCanceledDelay
      dcmPurgeQueueMessageCompletedDelay: P1D
      -
    

    and import it to the LDAP Server by using the ldapmodify command line utility.

  • or use the Add Attribute... and Add Value... function of Apache Directory Studio to add attributes on Device Level (e.g.: dicomDeviceName=dcm4chee-arc) and on Queue Descriptor level (e.g.: dcmQueueName=Export1) in the Archive Configuration.

One may refer to Archive Device and Queue Descriptor to understand the description of attributes.

Refer ISO-8601 Duration format for more know-how on Durations.

Go to the Control tab on Configuration page in archive UI and reload the configuration.

Testing

After the configurable delays have been reached, one can see the following in the Wildfly server logs.

11:34:04,144 INFO  [org.dcm4chee.arc.qmgt.impl.QueueManagerEJB] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Delete Task[id=ID:0b5b2ee7-e33f-11e8-b5ce-c47d4614bea4] from Queue Export1
11:34:04,153 INFO  [org.dcm4chee.arc.qmgt.impl.QueueManagerEJB] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Delete Task[id=ID:0f8c7c88-e33f-11e8-b5ce-c47d4614bea4] from Queue Export1
11:34:04,176 INFO  [org.dcm4chee.arc.qmgt.impl.PurgeQueueMessageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Deleted 2 COMPLETED messages from queue: Export1
11:34:04,193 INFO  [org.dcm4chee.arc.qmgt.impl.QueueManagerEJB] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Delete Task[id=ID:89f21ad0-e33f-11e8-b5ce-c47d4614bea4] from Queue Export1
11:34:04,201 INFO  [org.dcm4chee.arc.qmgt.impl.PurgeQueueMessageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Deleted 1 FAILED messages from queue: Export1
11:34:04,220 INFO  [org.dcm4chee.arc.qmgt.impl.QueueManagerEJB] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Delete Task[id=ID:15499a4a-e33f-11e8-b5ce-c47d4614bea4] from Queue Export1
11:34:04,234 INFO  [org.dcm4chee.arc.qmgt.impl.QueueManagerEJB] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Delete Task[id=ID:4e0debbe-e33f-11e8-b5ce-c47d4614bea4] from Queue Export1
11:34:04,247 INFO  [org.dcm4chee.arc.qmgt.impl.PurgeQueueMessageScheduler] (EE-ManagedScheduledExecutorService-default-Thread-13) 
Deleted 2 CANCELED messages from queue: Export1
Clone this wiki locally