Search code examples
springspring-mvcspring-websocketspring-messaging

@MessageMapping with placeholders


I am working with Spring-websocket and I have the following problem:

I am trying to put a placeholder inside a @MessageMapping annotation in order to get the url from properties. It works with @RequestMapping but not with @MessageMapping.

If I use this placeholder, the URL is null. Any idea or suggestion?

Example:

@RequestMapping(value= "${myProperty}")

@MessageMapping("${myProperty}")

Solution

  • Rossen Stoyanchev added placeholder support for @MessageMapping and @SubscribeMapping methods.

    See Jira issue: https://jira.spring.io/browse/SPR-13271