Messenger implementation problem.
sadcenter opened this issue ยท 2 comments
Description
Hi,
I'm using Nats
messaging system for my plugins to sync network so I also wanted to use it in luckperms, "why use 2 messaging systems instead of just one?". I checked the LuckPerms wiki for more information, unfortunately, there is nothing about adding your own implementation of a messenger, I found just one note It is also possible to provide your own implementation of this service via the LuckPerms API.
. Anyways, I've implemented Nats
messaging system. But I couldn't register it cause when I was trying to register it before messaging service loads - it was throwing an NotLoadedException
exception, when I was trying to register it after, it wasn't changing anything. After a few hours of searching in LuckPerms source-code, I found that you have to provide custom
messenger type in configuration to make API provider overwrite the current messenger.
Shouldn't it be in the wiki or something? I mean there is no info about it. I thought that I have to provide my name from MessengerProvider#getName
method, not custom
which is logically pretty obvious. Making people search in source code to find the one line that complicates everything is not a good point I think.
Proposed Behaviour
Add information to the wiki about adding your own implementation of messenger and note that you have to set custom
messenger in configuration.
Extra Details
No response
Hi @sadcenter
I guess the reason that custom
is not mentioned in the wiki for the messaging-service is because it's not really ever come up before? I do agree that adding a note about it might be a good idea though for those in future that are wanting to use a custom messaging service.
Added to the wiki - thanks for bringing the shortcoming to our attention and thanks @OmegaWeaponDev for your PR!