【发布时间】:2017-08-01 19:29:19
【问题描述】:
我正在尝试创建多个消费者,每个消费者只接收一种类型的消息,其中包含在消息上定义的某些属性:
例如,message.setProperty("id","someId");
我现在在为消费者设置选择器 JmsListener 时遇到问题:
@JmsListener(destination = "OMP.DEVICES", containerFactory = "jmsListenerFactory", selector=someVariable)
我想从我收到的变量中动态设置选择器值..
private String someVariable;
public void setsomeVariable(Long id){
someVariable="Id='"+id+"'";
}
但是我遇到了这个错误:
The value for annotation attribute JmsListener.selector must be a constant
我该如何解决?
谢谢
【问题讨论】:
标签: spring jms spring-jms