Oi, pessoal ! Estou com um problema na minha aplicação e não consigo avançar. Meu projeto roda todo ok, porém quando eu coloco essa linha na classe de configuração:
@Bean
public Queue paymentCompletedQueue() {
return new Queue("payment.completed", true);
}
Essa exception estoura e a aplicação se encerra:
com.rabbitmq.client.MalformedFrameException: AMQP protocol version mismatch; we are version 0-9-1, server sent signature 3,1,0,0
at com.rabbitmq.client.impl.Frame.protocolVersionMismatch(Frame.java:178) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:107) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:199) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:687) ~[amqp-client-5.21.0.jar:5.21.0]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
2024-05-24T16:26:04.418-03:00 ERROR 10012 --- [payment] [:0:0:0:0:1:5672] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occurred
com.rabbitmq.client.MalformedFrameException: AMQP protocol version mismatch; we are version 0-9-1, server sent signature 3,1,0,0
at com.rabbitmq.client.impl.Frame.protocolVersionMismatch(Frame.java:178) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:107) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:199) ~[amqp-client-5.21.0.jar:5.21.0]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:687) ~[amqp-client-5.21.0.jar:5.21.0]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
2024-05-24T16:26:04.468-03:00 ERROR 10012 --- [payment] [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.amqp.AmqpIOException: java.io.IOException
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:70) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:622) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:726) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:257) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2249) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2222) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2202) ~[spring-rabbit-3.1.5.jar:3.1.5]
at org.springframework.amqp.rabbit.core.RabbitAdmin.initialize(RabbitAdmin.java:699) ~[spring-rabbit-3.1.5.jar:3.1.5]
at mirna.food.payment.infra.amqp.config.PaymentAMQPConfiguration.lambda$0(PaymentAMQPConfiguration.java:27) ~[classes/:na]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185) ~[spring-context-6.1.8.jar:6.1.8]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178) ~[spring-context-6.1.8.jar:6.1.8]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156) ~[spring-context-6.1.8.jar:6.1.8]
O mesmo ocorre quando eu também coloco isso:
@Bean
public Queue paymentCompletedQueue() {
return QueueBuilder.nonDurable("payment.completed").build();
}
Ou seja, é um problema originado da criação de filas. Alguém ja viu isso antes ?