diff --git a/config_selector.module b/config_selector.module
index e97a105..1c8f1ca 100644
--- a/config_selector.module
+++ b/config_selector.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
 
 /**
  * Implements hook_help().
@@ -19,7 +20,7 @@ function config_selector_help($route_name, RouteMatchInterface $route_match) {
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Managing sets of configuration') . '</dt>';
-      $output .= '<dd>' . t('For example, if you want to provide a view that lists content that integrates with search_api or content_lock or both or neither. You can provide 4 different views in config/optional and as different dependencies are installed views are enabled and disabled according to a priority set with the configuration. Which configuration is enabled can be managed via the <a href=":ui_url">user interface</a>.', [':ui_url' => \Drupal::url('entity.config_selector_feature.collection')]) . '</dd>';
+      $output .= '<dd>' . t('For example, if you want to provide a view that lists content that integrates with search_api or content_lock or both or neither. You can provide 4 different views in config/optional and as different dependencies are installed views are enabled and disabled according to a priority set with the configuration. Which configuration is enabled can be managed via the <a href=":ui_url">user interface</a>.', [':ui_url' => Url::fromRoute('entity.config_selector_feature.collection')]) . '</dd>';
       $output .= '</dl>';
       return $output;
 
diff --git a/config_selector.services.yml b/config_selector.services.yml
index c3950f4..5c9ed40 100644
--- a/config_selector.services.yml
+++ b/config_selector.services.yml
@@ -1,7 +1,7 @@
 services:
   config_selector:
     class: Drupal\config_selector\ConfigSelector
-    arguments: ['@config.factory', '@config.manager', '@entity_type.manager', '@logger.channel.config_selector', '@state']
+    arguments: ['@config.factory', '@config.manager', '@entity_type.manager', '@logger.channel.config_selector', '@state', '@messenger']
   logger.channel.config_selector:
     parent: logger.channel_base
     arguments: ['config_selector']
diff --git a/src/ConfigSelector.php b/src/ConfigSelector.php
index 870b211..5a0b5e7 100644
--- a/src/ConfigSelector.php
+++ b/src/ConfigSelector.php
@@ -6,6 +6,7 @@ use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Config\ConfigManagerInterface;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Messenger\MessengerInterface;
 use Drupal\Core\State\StateInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Psr\Log\LoggerInterface;
@@ -63,6 +64,13 @@ class ConfigSelector {
    */
   protected $state;
 
+  /**
+   * The messenger service.
+   *
+   * @var \Drupal\Core\Messenger\MessengerInterface
+   */
+  protected $messenger;
+
   /**
    * ConfigSelector constructor.
    *
@@ -76,13 +84,16 @@ class ConfigSelector {
    *   The logger.
    * @param \Drupal\Core\State\StateInterface $state
    *   The state service.
+   * @param \Drupal\Core\Messenger\MessengerInterface $messenger
+   *   The messenger service.
    */
-  public function __construct(ConfigFactoryInterface $config_factory, ConfigManagerInterface $config_manager, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, StateInterface $state) {
+  public function __construct(ConfigFactoryInterface $config_factory, ConfigManagerInterface $config_manager, EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger, StateInterface $state, MessengerInterface $messenger) {
     $this->configFactory = $config_factory;
     $this->configManager = $config_manager;
     $this->entityTypeManager = $entity_type_manager;
     $this->logger = $logger;
     $this->state = $state;
+    $this->messenger = $messenger;
   }
 
   /**
@@ -190,7 +201,7 @@ class ConfigSelector {
         'Configuration <a href=":active_config_href">@active_config_label</a> has been enabled.',
         $variables
       );
-      $this->drupalSetMessage($this->t(
+      $this->messenger->addStatus($this->t(
         'Configuration <a href=":active_config_href">@active_config_label</a> has been enabled.',
         $variables
       ));
@@ -264,7 +275,7 @@ class ConfigSelector {
           'Configuration <a href=":disabled_config_href">@disabled_config_label</a> has been disabled in favor of <a href=":active_config_href">@active_config_label</a>.',
           $variables
         );
-        $this->drupalSetMessage($this->t(
+        $this->messenger->addStatus($this->t(
           'Configuration <a href=":disabled_config_href">@disabled_config_label</a> has been disabled in favor of <a href=":active_config_href">@active_config_label</a>.',
           $variables
         ));
@@ -273,25 +284,6 @@ class ConfigSelector {
     return $this;
   }
 
-  /**
-   * Wraps drupal_set_message().
-   *
-   * @param string|\Drupal\Component\Render\MarkupInterface $message
-   *   (optional) The translated message to be displayed to the user. For
-   *   consistency with other messages, it should begin with a capital letter
-   *   and end with a period.
-   * @param string $type
-   *   (optional) The message's type. Defaults to 'status'.
-   * @param bool $repeat
-   *   (optional) If this is FALSE and the message is already set, then the
-   *   message won't be repeated. Defaults to FALSE.
-   *
-   * @see drupal_set_message()
-   */
-  protected function drupalSetMessage($message = NULL, $type = 'status', $repeat = FALSE) {
-    drupal_set_message($message, $type, $repeat);
-  }
-
   /**
    * Generates a link for a configuration entity if possible.
    *
diff --git a/tests/src/Kernel/ConfigSelectorTest.php b/tests/src/Kernel/ConfigSelectorTest.php
index 6fca73b..40e9c7e 100644
--- a/tests/src/Kernel/ConfigSelectorTest.php
+++ b/tests/src/Kernel/ConfigSelectorTest.php
@@ -350,7 +350,7 @@ class ConfigSelectorTest extends KernelTestBase {
    *   (optional) The type of the expected messages. Defaults to 'status'.
    */
   protected function assertMessages(array $messages = [], $type = 'status') {
-    $actual_messages = drupal_get_messages($type);
+    $actual_messages = \Drupal::messenger()->messagesByType($type);
     if (!empty($actual_messages)) {
       $actual_messages = array_map('strval', $actual_messages[$type]);
     }
