aznamier / keycloak-event-listener-rabbitmq

Apache License 2.0
127 stars 51 forks source link

Channel not found #11

Closed vaggelis2018 closed 3 years ago

vaggelis2018 commented 3 years ago

Hello I am using the latest version of keycloak-event-listener and I get the following error.

keycloak-to-rabbitmq ERROR sending message: KK.EVENT.ADMIN.demoscope.SUCCESS.CLIENT.UPDATE
keycloak_1   | 09:01:52,367 ERROR [stderr] (default task-16) com.rabbitmq.client.AlreadyClosedException: channel is already closed due to channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'registrations' in vhost '/', class-id=60, method-id=40)

Is there any way to create the channel when starting the process with docker-compose. I tried to find a way to create the channel with the rabbitmq image but with no luck.

Thanks in advance.

aznamier commented 3 years ago

That looks like your configuration of Keycloak is trying to send messages to exchange: registrations but that does not exist on your Rabbit. Could you check that, and maybe share your current plugin configuration?

vaggelis2018 commented 3 years ago

@aznamier Yeap this is actually my problem. I want to create the channel when starting keycloak. I tried to find a way to create it from rabbitmq configuration and I had no luck with it. If I boot first the listeners they create the channel and I can publish the events. But not before they start.

aznamier commented 3 years ago

@vaggelis2018 I think the error says that you need to create the registrations exchange manually in RabbitMQ Server console first. Make sure its a topic type. Or just use the default exchange without any settings.

This plugin will not auto create anything in RabbitMQ as this requires usage of admin API and it is out of scope of what plugin should do.