Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
devel:documentation:architecture:dev:events [2019/02/12 09:52]
tomiskar
devel:documentation:architecture:dev:events [2020/03/30 12:49]
tomiskar
Line 74: Line 74:
     * ''IdmRoleDto'' - operation with the role     * ''IdmRoleDto'' - operation with the role
       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE'', ''EAV\_SAVE'', ''NOTIFY''       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE'', ''EAV\_SAVE'', ''NOTIFY''
 +      * adds event type ''DUPLICATE'' - duplicate role, event is published for create / update role duplicate, read more [[..:..:roles:dev:duplicate-role|here]].
     * ''IdmRoleGuaranteeDto'' - operation with the role guarantee by identity     * ''IdmRoleGuaranteeDto'' - operation with the role guarantee by identity
       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''
Line 108: Line 109:
       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''        * supports base event types ''CREATE'', ''UPDATE'', ''DELETE'' 
     * ''IdmLongRunningTaskDto'' - long running task     * ''IdmLongRunningTaskDto'' - long running task
 +      * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''
       * adds event type ''END'' - long running task ended.       * adds event type ''END'' - long running task ended.
     * ''IdmEntityEventDto'' - persisted event     * ''IdmEntityEventDto'' - persisted event
Line 120: Line 122:
     * ''IdmCodeListItemDto'' - code list items     * ''IdmCodeListItemDto'' - code list items
       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''       * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''
 +    * ''IdmNotificationTemplateDto'' - notification templates
 +      * supports base event types ''CREATE'', ''UPDATE'', ''DELETE''
 +    * ''IdmIdentityProjectionDto'' - identity form projections
 +      * supports base event types ''CREATE'', ''UPDATE''
   * ''acc'':   * ''acc'':
     * ''AccAccountDto'' - Accounts on target system     * ''AccAccountDto'' - Accounts on target system
Line 211: Line 217:
   * saving logs and archives in the new transaction (''Propagation.REQUIRES_NEW'')   * saving logs and archives in the new transaction (''Propagation.REQUIRES_NEW'')
  
 +===== Event properties =====
 +
 +Event properties (''Map'') can be specified for the event. Properties could be used in event processing. 
 +
 +Event properties are propagated automatically from parent into child event:
 +  * if parent event is given, when child event is published
 +  * if child event doesn't contain property with the same key - property can be preset manually and has a higher priority.
 +  * properties needed for internal event mechanism are not propagated. Property keys can be found in ''EntityEvent''.
 +
 +<note tip>When ''NOTIFY'' event is published and event will be processed synchronously (asynchronous event processing is disabled or event has ''IMMEDIATE'' priority), the properties set by processing ''NOTIFY'' event is also available in the original event.</note>
 ===== Asynchronous event processing ===== ===== Asynchronous event processing =====
  
Line 247: Line 263:
 Before event is persisted into queue, then event priority is evaluated, priority types: Before event is persisted into queue, then event priority is evaluated, priority types:
   * ''IMMEDIATE'' - immediate ~ synchronously. Event will be executed synchronously.   * ''IMMEDIATE'' - immediate ~ synchronously. Event will be executed synchronously.
-  * ''HIGH'' - asynchronously (7 / 10 in one cycle) +  * ''HIGH'' - asynchronously (7 / 10 in one cycle, batch size can be [[..:..:application_configuration:dev:backend#entity_events|configured]]
-  * ''NORMAL'' - asynchronously (3 / 10 in one cycle)+  * ''NORMAL'' - asynchronously (3 / 10 in one cycle, batch size can be [[..:..:application_configuration:dev:backend#entity_events|configured]])
  
 Events are processed from queue by internal scheduled tasks by priority. Events with ''HIGH'' priority will use 7 slots, events with ''NORMAL'' priority will use 3 slots => events will be processed **7 / 3**, when internal scheduled task for processing events will be executed. Events are processed from queue by internal scheduled tasks by priority. Events with ''HIGH'' priority will use 7 slots, events with ''NORMAL'' priority will use 3 slots => events will be processed **7 / 3**, when internal scheduled task for processing events will be executed.
Line 276: Line 292:
   * original source (embedded dtos and audit fields are ignored).   * original source (embedded dtos and audit fields are ignored).
  
-Older duplicate events are removed - the newest event is used. Events are processed by priority in bulk, default bulk size is **100 events** => duplicates are removed only in this bulk (not configurable for now, see future development). Bulk size is designed this way, because events are processed by priority - event with ''HIGH'' priority should not wait too long for another bulk is begin to process. Remove duplicates should be redesigned from scratch - remove duplicates through whole queue.+Older duplicate events are removed - the newest event is used. Events are processed by priority in batch, default batch size can be [[..:..:application_configuration:dev:backend#entity_events|configured]] => duplicates are removed only in this batch (not configurable for now, see future development). Batch size is designed this way, because events are processed by priority - event with ''HIGH'' priority should not wait too long for another bulk is begin to process. Remove duplicates should be redesigned from scratch - remove duplicates through whole queue.
  
 === Entity state === === Entity state ===
Line 627: Line 643:
 idm.sec.core.processor.core-role-code-environment-processor.enabled=true idm.sec.core.processor.core-role-code-environment-processor.enabled=true
 </code> </code>
 +
 +==== Duplicate role processors ====
 +
 +{{page>..:..:roles:dev:duplicate-role#processors}}
 +
 +
 +
 ===== Example ===== ===== Example =====
 ==== Synchronous processor ==== ==== Synchronous processor ====
Line 731: Line 754:
 } }
 </code> </code>
 +
  
 ===== Future development ===== ===== Future development =====
  • by tomiskar