org.springframework.messaging.simp.broker

## Class SimpleBrokerMessageHandler

- java.lang.Object
- - org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler
  - - org.springframework.messaging.simp.broker.SimpleBrokerMessageHandler

- All Implemented Interfaces:
    Aware, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, MessageHandler

      public class SimpleBrokerMessageHandler
      extends AbstractBrokerMessageHandler

  A "simple" message broker that recognizes the message types defined in `SimpMessageType`, keeps track of subscriptions with the help of a `SubscriptionRegistry` and sends messages to subscribers.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Field Summary

    - ### Fields inherited from class org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SubscribableChannel brokerChannel, Collection<String> destinationPrefixes)` Create a SimpleBrokerMessageHandler instance with the given message channels and destination prefixes.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SubscribableChannel` | `getBrokerChannel()`
    `SubscribableChannel` | `getClientInboundChannel()`
    `MessageChannel` | `getClientOutboundChannel()`
    `SubscriptionRegistry` | `getSubscriptionRegistry()`
    `protected void` | `handleMessageInternal(Message<?> message)`
    `protected void` | `sendMessageToSubscribers(String destination, Message<?> message)`
    `void` | `setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry)`
    `void` | `startInternal()`
    `void` | `stopInternal()`

    - ### Methods inherited from class org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler

      `checkDestinationPrefix, getApplicationEventPublisher, getDestinationPrefixes, getPhase, handleMessage, isAutoStartup, isBrokerAvailable, isRunning, publishBrokerAvailableEvent, publishBrokerUnavailableEvent, setApplicationEventPublisher, setAutoStartup, start, stop, stop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleBrokerMessageHandler

          public SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel,
                                            MessageChannel clientOutboundChannel,
                                            SubscribableChannel brokerChannel,
                                            Collection<String> destinationPrefixes)

      Create a SimpleBrokerMessageHandler instance with the given message channels and destination prefixes.
      Parameters:
        `clientInboundChannel` - the channel for receiving messages from clients (e.g. WebSocket clients)
        `clientOutboundChannel` - the channel for sending messages to clients (e.g. WebSocket clients)
        `brokerChannel` - the channel for the application to send messages to the broker

  - ### Method Detail

    - #### getClientInboundChannel

          public SubscribableChannel getClientInboundChannel()

    - #### getClientOutboundChannel

          public MessageChannel getClientOutboundChannel()

    - #### getBrokerChannel

          public SubscribableChannel getBrokerChannel()

    - #### setSubscriptionRegistry

          public void setSubscriptionRegistry(SubscriptionRegistry subscriptionRegistry)

    - #### getSubscriptionRegistry

          public SubscriptionRegistry getSubscriptionRegistry()

    - #### startInternal

          public void startInternal()

      Overrides:
        `startInternal` in class `AbstractBrokerMessageHandler`

    - #### stopInternal

          public void stopInternal()

      Overrides:
        `stopInternal` in class `AbstractBrokerMessageHandler`

    - #### handleMessageInternal

          protected void handleMessageInternal(Message<?> message)

      Specified by:
        `handleMessageInternal` in class `AbstractBrokerMessageHandler`

    - #### sendMessageToSubscribers

          protected void sendMessageToSubscribers(String destination,
                                                  Message<?> message)