SimpMessagingTemplateThe bean is designed specifically for the Broker ( AbstractMessageBrokerConfiguration) part:
@Bean
public SimpMessagingTemplate brokerMessagingTemplate() {
SimpMessagingTemplate template = new SimpMessagingTemplate(brokerChannel());
String prefix = getBrokerRegistry().getUserDestinationPrefix();
if (prefix != null) {
template.setUserDestinationPrefix(prefix);
}
Since you are not sending the message to the broker's addressee ( /app/in your case), such a message is simply ignored AbstractBrokerMessageHandler.checkDestinationPrefix(destination).
@MessageMapping, clientInboundChannel , SimpAnnotationMethodMessageHandler:
@Bean
public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler() {
SimpAnnotationMethodMessageHandler handler = createAnnotationMethodMessageHandler();
handler.setDestinationPrefixes(getBrokerRegistry().getApplicationDestinationPrefixes());
, SimpMessagingTemplate clientInboundChannel, brokerMessagingTemplate bean. .