spring - @RabbitListener is not working with queue names pattern -
me using spring boot project need listen few queues @ run time pattern enables in rabbitlister.
i have tried @rabbitlistener(queues="queue*")
.
but throws exception constant should used in queue name.
any appreciated .
and have query json convertor in spring boot rabbitmq:
@bean simplemessagelistenercontainer container(connectionfactory connectionfactory, messagelisteneradapter listeneradapter,queue notificationqueue) { simplemessagelistenercontainer container = new simplemessagelistenercontainer(); container.setconnectionfactory(connectionfactory); container.setqueuenames(notificationqueue.getname()); container.setmessagelistener(listeneradapter); return container; } @bean reciver receiver() { return new reciver (); } @bean messagelisteneradapter listeneradapter(reciver receiver) { return new messagelisteneradapter(receiver,"receivemethod"); }
and in reciever
receivemethod(message msg){ //code }
here exception says
org.springframework.amqp.rabbit.listener.exception.listenerexecutionfailedexception: failed invoke target method 'onmessage' argument type = [class [b], value = [{[b@4ed663ad}] @ org.springframework.amqp.rabbit.listener.adapter.messagelisteneradapter.invokelistenermethod(messagelisteneradapter.java:408) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.adapter.messagelisteneradapter.onmessage(messagelisteneradapter.java:298) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.abstractmessagelistenercontainer.doinvokelistener(abstractmessagelistenercontainer.java:757) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.abstractmessagelistenercontainer.invokelistener(abstractmessagelistenercontainer.java:680) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer.access$001(simplemessagelistenercontainer.java:93) [spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer$1.invokelistener(simplemessagelistenercontainer.java:183) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer.invokelistener(simplemessagelistenercontainer.java:1358) [spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.abstractmessagelistenercontainer.executelistener(abstractmessagelistenercontainer.java:661) ~[spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer.doreceiveandexecute(simplemessagelistenercontainer.java:1102) [spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer.receiveandexecute(simplemessagelistenercontainer.java:1086) [spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer.access$1100(simplemessagelistenercontainer.java:93) [spring-rabbit-1.5.5.release.jar:na] @ org.springframework.amqp.rabbit.listener.simplemessagelistenercontainer$asyncmessageprocessingconsumer.run(simplemessagelistenercontainer.java:1203) [spring-rabbit-1.5.5.release.jar:na] @ java.lang.thread.run(unknown source) [na:1.8.0_77] caused by: java.lang.nosuchmethodexception: com.mdm.amqp.mdmnotificationlistener.onmessage([b) @ java.lang.class.getmethod(unknown source) ~[na:1.8.0_77] @ org.springframework.util.methodinvoker.prepare(methodinvoker.java:174) ~[spring-core-4.2.5.release.jar:4.2.5.release] @ org.springframework.amqp.rabbit.listener.adapter.messagelisteneradapter.invokelistenermethod(messagelisteneradapter.java:386) ~[spring-rabbit-1.5.5.release.jar:na] ... 12 common frames omitted
Comments
Post a Comment