lerenn / asyncapi-codegen

An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
76 stars 21 forks source link

Nats Jetstream: consuming a message without subscription causes deadlock in the consumer #206

Closed mymdz closed 2 months ago

mymdz commented 2 months ago

Steps to reproduce:

  1. Generate multiple operations: A and B
  2. Subscribe to a specific subject (A) using UserController, without UserSubscriber implementation
  3. Send a message to B. A warning will be printed: Received message for not subscribed channel 'B'. Message will be ack'd.
  4. Send a message to A - nothing happens

There is a deadlock because of writing to nil channel

mymdz commented 2 months ago

Fixed with https://github.com/lerenn/asyncapi-codegen/pull/207

lerenn commented 2 months ago

Hello @mymdz ! Good jobs ! Thanks for taking the time to report the bug AND to bring a fix ! ☺️ I'll review it ASAP and I'll merge it (maybe not today, but tomorrow).