Closed me23 closed 11 months ago
Good question, but I don't think it's a bug. The publish doesn't create queues just puts the message to existing queues. Libraries of other adapters auto-create the queues if not exist. I will check what we can do, because in RabbitMQ there is several settings of the queues, so it means, you should define these settings in every publish (because you don't know whether the queue is exist or not). But I think it's not a good solution.
Maybe we could define a auto-create option and if it set, the service will check and create the necessary channels on startup?
Just to add, not sure if this is a different issue, but I did the following:
IllegalOperationError: Channel closed
Step 3 should work, since listener is still available!
Just tested with master branch. It is now fixed. Guess I have to ask when it will be released? :-)
I did one more test on the master branch where this code has been merged:
Actually, if a subscriber comes, then goes away (say a crash), and a message is sent in the meantime, the message is delivered when the subscriber comes back. The only issue here seems to be if the subscriber never started and a message is sent, and then the subscriber connects, the message is not delivered.
Currently the subscriber creates the queues, so if you send the message when the queue is not exists, it won't be delivered. However, it should throw error if no queue.
It did not, or at least I don't think so, and subsequent messages to queues that did exist would also not work. However, this seems have been fixed in the master branch. But now if the queue does not exist, it won't crash, but it does not seem to throw an error either. Message is just swallowed/dropped. I am testing from the REPL console.
Can you please provide a repro example? I would like to debug the issue
Clone this repo: https://github.com/me23/moleculer-channels-amqp-test
Failure
Success:
You should define the publishAssertExchange
to use this feature. More info: https://github.com/moleculerjs/moleculer-channels/pull/63#pullrequestreview-1302006083
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Starting with an fresh instance of rabbitmq and trigger sendToChannel from moleculer i got follow Error:
[2022-05-10T07:30:40.939Z] ERROR my-client/CHANNELS: AMQP channel error Error: Channel closed by server: 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'something.done' in vhost '/'"
and the client exits with unhandled Promise-rejection.
As soon if i start a listener for this channel (somthing.done) once, even if i stop the listener again, then it works like expected.
Expected Behavior
I don't know if its an bug or a feature, but i expected the channel to be created either if the first listener register or if the first producer send some messages in.
My idea was to send some events with a ttl-value, so if nobody cares about it, it will be deleted. As soon as one consumer came up, he can use the stored events. no exchange
Failure Information
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs