private void updateStompHeadersFromSimpMessageHeaders() {
   if (getDestination() != null) {
     setNativeHeader(STOMP_DESTINATION_HEADER, getDestination());
   }
   if (getContentType() != null) {
     setNativeHeader(STOMP_CONTENT_TYPE_HEADER, getContentType().toString());
   }
   trySetStompHeaderForSubscriptionId();
 }
  public void updateStompCommandAsServerMessage() {

    Assert.state(
        SimpMessageType.MESSAGE.equals(getMessageType()),
        "Unexpected message type " + getMessage());

    StompCommand command = getCommand();
    if ((command == null) || StompCommand.SEND.equals(command)) {
      setHeader(COMMAND_HEADER, StompCommand.MESSAGE);
    } else if (!StompCommand.MESSAGE.equals(command)) {
      throw new IllegalStateException("Unexpected STOMP command " + command);
    }

    trySetStompHeaderForSubscriptionId();

    if (getMessageId() == null) {
      String messageId = getSessionId() + "-" + messageIdCounter.getAndIncrement();
      setNativeHeader(STOMP_MESSAGE_ID_HEADER, messageId);
    }
  }
 @Override
 public void setSubscriptionId(String subscriptionId) {
   super.setSubscriptionId(subscriptionId);
   trySetStompHeaderForSubscriptionId();
 }