Spring boot- RabbitMQ consumer keep on printing "Retrieving delivery for Consumer" -
hi using spring boot 1.3.5 along starter rabbitmq. in project having rabbitmq consumer consumes messages particular queue.but while running application keeps on printing below message in console.while browsing in google read setting heartbeat resolve issue no luck me,
14:08:14.892 [simpleasynctaskexecutor-1] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-rdkzctoxlmwqf4ffuihs0a=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,3), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [delegate=amqp://guest@127.0.0.1:5672/], acknowledgemode=auto local queue size=0 14:08:14.913 [simpleasynctaskexecutor-3] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-jxyjmkfw6heu77xvdyh3tw=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,2), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [delegate=amqp://guest@127.0.0.1:5672/], acknowledgemode=auto local queue size=0 14:08:14.917 [simpleasynctaskexecutor-2] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-acbx0r5em-ukqwn0a_nrwa=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,1), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [delegate=amqp://guest@127.0.0.1:5672/], acknowledgemode=auto local queue size=0 14:08:15.893 [simpleasynctaskexecutor-1] debug o.s.a.r.l.blockingqueueconsumer - retrieving delivery consumer: tags=[{amq.ctag-rdkzctoxlmwqf4ffuihs0a=notificationqueue}], channel=cached rabbit channel: amqchannel(amqp://guest@127.0.0.1:5672/,3), conn: proxy@47914ea3 shared rabbit connection: simpleconnection@1096fe75 [delegate=amqp://guest@127.0.0.1:5672/], acknowledgemode=auto local queue size=0
it's ever ending.kindly find below consumer code:
rabbitmqconfiguration.java
import org.springframework.amqp.rabbit.annotation.enablerabbit; import org.springframework.amqp.rabbit.config.simplerabbitlistenercontainerfactory; import org.springframework.amqp.rabbit.connection.cachingconnectionfactory; import org.springframework.amqp.support.converter.jackson2jsonmessageconverter; import org.springframework.amqp.support.converter.messageconverter; import org.springframework.beans.factory.annotation.autowired; import org.springframework.beans.factory.annotation.value; import org.springframework.context.annotation.bean; import org.springframework.context.annotation.configuration; @configuration @enablerabbit public class rabbitmqconfiguration{ @autowired private cachingconnectionfactory cachingconnectionfactory; @value("${concurrent.consumers}") public int concurrent_consumers; @value("${max.concurrent.consumers}") public int max_concurrent_consumers; @bean public simplerabbitlistenercontainerfactory rabbitlistenercontainerfactory() { simplerabbitlistenercontainerfactory factory = new simplerabbitlistenercontainerfactory(); factory.setconnectionfactory(cachingconnectionfactory); factory.setconcurrentconsumers(concurrent_consumers); factory.setmaxconcurrentconsumers(max_concurrent_consumers); factory.setmessageconverter(jsonmessageconverter()); return factory; } @bean public messageconverter jsonmessageconverter() { final jackson2jsonmessageconverter converter = new jackson2jsonmessageconverter(); return converter; } }
notificationconsumer.java
@component public class notificationconsumer { private static final logger logger = loggerfactory.getlogger(notificationconsumer.class); @value("${notification.queue}") public string notificationqueue; @rabbitlistener(id="notification",containerfactory="rabbitlistenercontainerfactory",queues = "#{notificationqueue}") public void handlenotificationmessage(transaction transaction) { system.out.println("entered handlenotificationmessage::"+transaction.getid()); system.out.println("exit handlenotificationmessage::"+transaction.getdata()); logger.info("entered handlenotificationmessage::", transaction.getid()); logger.info("exit handlenotificationmessage::", transaction.getdata()); } @bean public queue notificationqueue() { return new queue(notificationqueue, true, false, false); } }
application.yml
spring: rabbitmq: addresses: 127.0.0.1:5672 adminaddresses: http://127.0.0.1:15672 username: guest password: guest requested-heartbeat: 60 spring.rabbit.exchange: notification-exchange notification.queue: notificationqueue concurrent.consumers: 3 max.concurrent.consumers: 10
message produced application , application consume message.
your should appreciated.
as per gary flipped logger level debug info resolved issue.
logging: level: root: info
now getting following exception:
15:21:24.925 [simpleasynctaskexecutor-2] warn o.s.a.r.l.conditionalrejectingerrorhandler - fatal message conversion error; message rejected; dropped or routed dead letter exchange, if configured: (body:'{"id":"5784eed4f5a64b4d8663e706","clientidentifier":"313131313131", "data":"sample data vad","currentaction":{"state":{"status":"pending","errorcode":"404"},"data":"sample data"}, "haserror":false,"errormessage":""}'messageproperties [headers={__typeid__=com.global.produce.model.transaction}, timestamp=null, messageid=null, userid=null, appid=null, clusterid=null, type=null, correlationid=null, replyto=null, contenttype=application/json, contentencoding=utf-8, contentlength=0, deliverymode=persistent, expiration=null, priority=0, redelivered=false, receivedexchange=, receivedroutingkey=notificationqueue, deliverytag=1, messagecount=0])
anyone have idea error?
that's debug
log; change log settings info or warn or error.
Comments
Post a Comment