-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No PublishInboundInterceptor added in extension for clients connected before startup (restart) #438
Comments
Hello @globz-eu, can you explain what you mean with connected clients? Because the HiveMQ broker does not open the MQTT listeners before the extension system has been run through, aka all extension completed. As you can see the broker waits before doing anything else, when I have a sleep in my extensionStart
Greetings, |
I had a look at your code. You asynchronously add the interceptor, so I tested it and you are correct that the interceptor are not applied to already connected clients. Though I'm not sure what the intended behaviour is, as one could argue when an extension said it started that it allocated all necessary resources so it can operate. I'll start a discussion internally. As I don't know when this will be tackled, can I ask you why you need all this async steps during the extensionStart phase? EDIT: Simple reproducer code:
Greetings, |
Expected behavior
When the HiveMQ CE broker starts (or restarts) with the artcom/hivemq-retained-message-query-plugin extension, the extension should add a PublishInboundInterceptor for all clients connected to the broker.
Actual behavior
When the HiveMQ CE broker starts (or restarts) with the artcom/hivemq-retained-message-query-plugin extension:
To Reproduce
Steps
Reproducer code
git clone https://github.com/artcom/retained-message-query-plugin-test.git cd retained-message-query-plugin-test docker compose -f compose-ce.yml up --build docker compose -f compose-ce.yml stop broker docker compose -f compose-ce.yml start broker
The following message is logged when a PublishInboundInterceptor is added to a client:
DEBUG - Adding a PublishInboundInterceptor to client id UnknownApp-<randomId>
Details
When the client service is restarted after the extension was iniitalized the PublishInboundInterceptor is added for that client (as seen in the logs). This can be reproduced with:
When using the enterprise edition of the broker a PublishInboundInterceptor is added to all connected clients regardless of when they connected. This can be verified by using the
compose-ee.yml
file.Affected HiveMQ CE version(s): 2023.9
Used JVM version: 11
The text was updated successfully, but these errors were encountered: