title: Spring WebSockets - how to apply @DestinationVariable only to @SendTo annotation?
body: <p>I'm trying to apply a destination variable to a method in my controller that handles incoming messages from WebSocket. Here's what I want to achieve:</p>
  
  <pre><code>@Controller
  public class DocumentWebsocketController {
  
      @MessageMapping("/lock-document")
      @SendTo("/notify-open-documents/{id}")
      public Response response(@DestinationVariable("id") Long id, Message message) {
          return new Response(message.getDocumentId());
      }
  }
  </code></pre>
  
  <p>The problem is, that the destination variable is applied only to <code>@SendTo</code> annotation. It causes following stack trace while attempting this endpoint:</p>
  
  <pre><code>12:36:43.044 [clientInboundChannel-7] ERROR org.springframework.web.socket.messaging.WebSocketAnnotationMethodMessageHandler - Unhandled exception
  org.springframework.messaging.MessageHandlingException: Missing path template variable 'id' for method parameter type [class java.lang.Long]
      at org.springframework.messaging.handler.annotation.support.DestinationVariableMethodArgumentResolver.handleMissingValue(DestinationVariableMethodArgumentResolver.java:70) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
      at org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:96) ~[spring-messaging-4.2.4.RELEASE.jar:4.2.4.RELEASE]
  
  (...)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
          at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
  </code></pre>
  
  <p><strong>My question is:</strong> is something like I want to achieve possible at all?</p>