首页 > TAG信息列表 > spring-messaging

春天-@MessageMapping与占位符

我正在使用Spring-websocket,但遇到以下问题: 我试图将一个占位符放在@MessageMapping批注中,以便从属性获取url.它适用于@RequestMapping,但不适用于@MessageMapping. 如果使用此占位符,则URL为null.有什么想法或建议吗? 例: @RequestMapping(value= "${myProperty}") @MessageMapp

java-如何在JmsMessagingTemplate.sendAndReceive上设置等待超时

我在MVC控制器中使用来自JmsMessagingTemplate的sendAndReceive,但是如果没有发送回复消息,它似乎永远都在等待回复.该文档指出: Returns: the reply, possibly null if the message could not be received, for example due to a timeout 但是我只是不知道在指定了多长时间或

java – Spring中@Service注释的功能

这是一种“什么是@Service注释?”问题,但另一种方法.因为,我不确定这里发生了什么: 我有一个控制器类: @Controller public class GreetingController { @Autowired SomeBean someBean; @MessageMapping("/msg") public String msg() { someBean.handleMsg(

如何使用Object有效负载而不是MessageCollector中的字符串接收GenericMessage

我尝试使用MessageCollector测试通过spring-cloud-stream发送和接收消息. 当我使用本机java序列化的流云时,一切正常,但当我将序列化更改为json时,MessageCollector返回GenericMessage与字符串有效负载而不是SomeObject有效负载. 配置是 cloud.stream.default.contentType=appli

如何使用我的.properties文件中的自定义消息,但使用@Size注释提供的参数?

这应该是一个简单的问题,但我找不到直接的解决方案. 我正在使用Spring Message Resource从.properties文件中提供我系统上的所有文本.我需要那些国际化问题,不能使用Spring的默认消息. 这是问题所在: 我的.properties文件中有以下行: validator_invalid_state_name=Invalid name ({m