Class CrudEntityHelperProperties.NotificationProperties
- Enclosing class:
- CrudEntityHelperProperties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanUpon any CRUD operation,CrudEntityHelperwill automatically try to emit aPersistenceProducer.TYPEmessage for the affected entity record.voidsetHandlePersistenceMessageAsync(boolean handlePersistenceMessageAsync) Upon any CRUD operation,CrudEntityHelperwill automatically try to emit aPersistenceProducer.TYPEmessage for the affected entity record.
-
Constructor Details
-
NotificationProperties
public NotificationProperties()
-
-
Method Details
-
isHandlePersistenceMessageAsync
public boolean isHandlePersistenceMessageAsync()Upon any CRUD operation,CrudEntityHelperwill automatically try to emit aPersistenceProducer.TYPEmessage for the affected entity record. This property controls whether that message is emitted viaNotificationManager.handleAsync(NotificationStateRepository, NotificationStateAware, String)(the default) orNotificationManager.handle(NotificationStateRepository, NotificationStateAware, String).Either way the message is only produced once the surrounding transaction commits, and a failed send is retried on a background thread, so a deployment should not depend on the message having been handed to the broker by the time the CRUD call returns. This is primarily useful for integration tests that assert on a message having been sent immediately after the operation under test.
Note that this governs
PersistenceProducer.TYPEonly. Change summary and index request messages are always emitted asynchronously. To force every message type to be handled synchronously, disablebroadleaf.notification.manager.async-enabledinstead. -
setHandlePersistenceMessageAsync
public void setHandlePersistenceMessageAsync(boolean handlePersistenceMessageAsync) Upon any CRUD operation,CrudEntityHelperwill automatically try to emit aPersistenceProducer.TYPEmessage for the affected entity record. This property controls whether that message is emitted viaNotificationManager.handleAsync(NotificationStateRepository, NotificationStateAware, String)(the default) orNotificationManager.handle(NotificationStateRepository, NotificationStateAware, String).Either way the message is only produced once the surrounding transaction commits, and a failed send is retried on a background thread, so a deployment should not depend on the message having been handed to the broker by the time the CRUD call returns. This is primarily useful for integration tests that assert on a message having been sent immediately after the operation under test.
Note that this governs
PersistenceProducer.TYPEonly. Change summary and index request messages are always emitted asynchronously. To force every message type to be handled synchronously, disablebroadleaf.notification.manager.async-enabledinstead.
-