Class UserCreationListener


  • @DataRouteByKey("customer")
    public class UserCreationListener
    extends Object
    • Constructor Detail

      • UserCreationListener

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

      • listen

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

        protected void processStateChange​(@NonNull
                                          @NonNull org.springframework.messaging.Message<UserCreatedEvent> message)
        Based on the contents of the UserCreatedEvent, update the Customer with the provided User data
        Parameters:
        message - the message to be processed
      • updateCustomer

        protected void updateCustomer​(User user,
                                      Customer customer)
        Updates an existing customer. We're only concerned with Auth's user_id field.
        Parameters:
        user -
        customer -
      • getIdempotentConsumptionService

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