quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.92k stars 1.43k forks source link

amqp-quickstart : error @ amqp-quickstart using RabbitMQ #379

Open sheryf opened 4 years ago

sheryf commented 4 years ago

2019-11-17 11:28:07,268 SEVERE [io.ver.cor.net.imp.ConnectionBase] (vert.x-eventloop-thread-0) An existing connection was forcibly closed by the remote host 2019-11-17 11:28:12,081 SEVERE [io.ver.cor.net.imp.ConnectionBase] (vert.x-eventloop-thread-1) An existing connection was forcibly closed by the remote host 2019-11-17 11:28:12,082 ERROR [io.sma.rea.mes.amq.AmqpConnector] (vert.x-eventloop-thread-1) Unable to send the AMQP message: java.util.concurrent.CompletionException: io.vertx.core.VertxException: Disconnected at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292) at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308) at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:593) at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) at io.vertx.axle.AsyncResultCompletionStage.lambda$toCompletionStage$0(AsyncResultCompletionStage.java:20) at io.vertx.axle.amqp.AmqpClient$4.handle(AmqpClient.java:232) at io.vertx.axle.amqp.AmqpClient$4.handle(AmqpClient.java:227) at io.vertx.amqp.impl.AmqpClientImpl.lambda$createSender$4(AmqpClientImpl.java:111) at io.vertx.amqp.impl.AmqpConnectionImpl.lambda$connect$4(AmqpConnectionImpl.java:116) at io.vertx.proton.impl.ProtonClientImpl$ConnectCompletionHandler.handle(ProtonClientImpl.java:123) at io.vertx.proton.impl.ProtonClientImpl.lambda$null$0(ProtonClientImpl.java:81) at io.vertx.proton.impl.ProtonConnectionImpl.fireDisconnect(ProtonConnectionImpl.java:381) at io.vertx.proton.impl.ProtonTransport.handleSocketEnd(ProtonTransport.java:94) at io.vertx.core.net.impl.NetSocketImpl.lambda$new$2(NetSocketImpl.java:96) at io.vertx.core.streams.impl.InboundBuffer.handleEvent(InboundBuffer.java:237) at io.vertx.core.streams.impl.InboundBuffer.write(InboundBuffer.java:127) at io.vertx.core.net.impl.NetSocketImpl.handleClosed(NetSocketImpl.java:356) at io.vertx.core.net.impl.VertxHandler.lambda$channelInactive$4(VertxHandler.java:162) at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369) at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43) at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:232) at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:224) at io.vertx.core.net.impl.VertxHandler.channelInactive(VertxHandler.java:162) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:236) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1417) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:257) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:243) at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:913) at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.lang.Thread.run(Thread.java:748)

belkevglaz commented 4 years ago

Have the same issue with RabbitMQ 3.8.2 If I run amqp-quickstart with default docker-compose - all working as described, but when change docker-compose file to use RabbitMQ :

version: '2'

services:
  rabbitmq:
    image: rabbitmq:3.8.2-management
    ports:
      - 5672:5672
      - 15672:15672
    environment:
      RABBITMQ_USER quarkus
      RABBITMQ_PASSWORD quarkus

I got the same problem as @sheryf Is there any where working example not for Kafka & ActiveMQ, but with RabbitMQ? I Is in AMQP 1.0 supporting by RabbitMQ problem ?

belkevglaz commented 4 years ago

Update: The issue is really in AMQP 1.0. RabbitMQ works by default in AMQP 0-9-1, but quarkus & smallrye & microprofile & vertx works over AMPQ 1.0. In logs of rabbit I saw these erorrs :

2020-02-20 14:49:29.427 [error] <0.1040.0> closing AMQP connection <0.1040.0> (172.20.0.1:37896 -> 172.20.0.3:5672):
amqp1_0_plugin_not_enabled

After enable 1.0 on rabbitmq using command rabbitmq-plugins enable rabbitmq_amqp1_0 the error was gone and I was able to post a message.

lfmunoz commented 4 years ago

What's the solution to this if I can't modify the the the rabbitmq instance? Is it to write a new extension using vertx rabbitmq client instead of the ampq client?

cescoffier commented 4 years ago

Yes, you would need to implement a Connector using the RabbitMQ client. Feel free to open a PR on SmallRye Reactive Messaging. I would be happy to help if you need assistance.