Class CrudEntityHelperProperties.NotificationProperties

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.autoconfigure.CrudEntityHelperProperties.NotificationProperties
Enclosing class:
CrudEntityHelperProperties

public static class CrudEntityHelperProperties.NotificationProperties extends Object
  • Constructor Details

    • NotificationProperties

      public NotificationProperties()
  • Method Details

    • isHandlePersistenceMessageAsync

      public boolean isHandlePersistenceMessageAsync()
      Upon any CRUD operation, CrudEntityHelper will automatically try to emit a PersistenceProducer.TYPE message for the affected entity record. This property controls whether that message is emitted via NotificationManager.handleAsync(NotificationStateRepository, NotificationStateAware, String) (the default) or NotificationManager.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.TYPE only. Change summary and index request messages are always emitted asynchronously. To force every message type to be handled synchronously, disable broadleaf.notification.manager.async-enabled instead.

    • setHandlePersistenceMessageAsync

      public void setHandlePersistenceMessageAsync(boolean handlePersistenceMessageAsync)
      Upon any CRUD operation, CrudEntityHelper will automatically try to emit a PersistenceProducer.TYPE message for the affected entity record. This property controls whether that message is emitted via NotificationManager.handleAsync(NotificationStateRepository, NotificationStateAware, String) (the default) or NotificationManager.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.TYPE only. Change summary and index request messages are always emitted asynchronously. To force every message type to be handled synchronously, disable broadleaf.notification.manager.async-enabled instead.