Class UserRegistrationListener


  • @DataRouteByKey("customer")
    public class UserRegistrationListener
    extends Object
    Listens to customer user registration events and creates a new corresponding Customer.
    • Constructor Detail

      • UserRegistrationListener

        public UserRegistrationListener​(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService,
                                        CustomerService<Customer> customerService)
    • Method Detail

      • listen

        @StreamListener("userRegistrationInput")
        public void listen​(@NonNull
                           @NonNull org.springframework.messaging.Message<UserCreatedEvent> message)
      • processMessage

        protected void processMessage​(@NonNull
                                      @NonNull org.springframework.messaging.Message<UserCreatedEvent> message)
        Based on the contents of the UserCreatedEvent, create a new Customer
        Parameters:
        message - the message to be processed
      • validateUserPayload

        protected void validateUserPayload​(User user)
      • assertIsCustomerType

        protected void assertIsCustomerType​(User user)
      • assertHasServiceId

        protected void assertHasServiceId​(User user)
      • buildContextInfo

        protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo​(User user)
      • getIdempotentConsumptionService

        protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService()