sample spring boot with rabbitmq
gustavoorsi / rabbitmq-consumer-receiver Goto Github PK
View Code? Open in Web Editor NEWsample spring boot with rabbitmq
sample spring boot with rabbitmq
sample spring boot with rabbitmq
First of all , sorry for posting this in an issue.
I downloaded the project. Need to execute this project.
Can i get the steps to execute this project ?
Hi,
how do i specify the cloudAMQP credential info ?
when i run the producer springboot app, i get the following error.
Exception in thread "main" java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:675)
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at demo.producer.ProducerApplication.main(ProducerApplication.java:20)
Caused by: org.springframework.messaging.MessagingException: java.io.IOException; nested exception is org.springframework.amqp.AmqpIOException: java.io.IOException
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.convertAmqpException(RabbitMessagingTemplate.java:263)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.doSend(RabbitMessagingTemplate.java:193)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.send(RabbitMessagingTemplate.java:110)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.convertAndSend(RabbitMessagingTemplate.java:137)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.convertAndSend(RabbitMessagingTemplate.java:122)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.convertAndSend(RabbitMessagingTemplate.java:115)
at demo.producer.Sender.sendToRabbitmq(ProducerApplication.java:75)
at demo.producer.ProducerApplication.run(ProducerApplication.java:59)
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:672)
... 5 more
Caused by: org.springframework.amqp.AmqpIOException: java.io.IOException
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:63)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:217)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:444)
at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils$1.createConnection(ConnectionFactoryUtils.java:80)
at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.doGetTransactionalResourceHolder(ConnectionFactoryUtils.java:130)
at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactoryUtils.java:67)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1035)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1028)
at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:540)
at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:534)
at org.springframework.amqp.rabbit.core.RabbitMessagingTemplate.doSend(RabbitMessagingTemplate.java:190)
... 12 more
Caused by: java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:348)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:603)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:204)
... 21 more
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:348)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:294)
... 23 more
Caused by: java.net.SocketTimeoutException: Timeout during Connection negotiation
at com.rabbitmq.client.impl.AMQConnection.handleSocketTimeout(AMQConnection.java:585)
at com.rabbitmq.client.impl.AMQConnection.access$600(AMQConnection.java:65)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:560)
at java.lang.Thread.run(Thread.java:748)
Hi,
Thank you for sharing.
The consumer can run properly with json format input. However, if I publish a non-json message, it will have problem, the exception stack goes like following.
org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException
org.springframework.amqp.support.converter.MessageConversionException
org.springframework.messaging.converter.MessageConversionException
com.fasterxml.jackson.core.JsonParseException
It's fine for me to see exceptions. I want to catch them and handle by myself. Do you have any idea how to do it? The conversion errors happen inside the jackson2Converter, which is out of control of user code. So I don't know how can I catch these exceptions.
Thanks and Regards,
Ruijie
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.