apache / apache/apisix-java-plugin-runner

help request: How to Detect WebSocket Connection Closure in Java Plugin Development for APISIX?

Offen
#323 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
question
Vorherrschende Sprache
Java
Sterne
152
Forks
102
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

Hello APISIX Team,

I am currently developing a custom Java plugin for APISIX and would like to implement functionality similar to the limit-conn plugin. However, I have encountered an issue regarding WebSocket connections.

In my plugin, I need to maintain a count of active WebSocket connections and decrement the count when a connection is closed. Unfortunately, the provided SDK does not seem to expose a callback or event mechanism to detect when a WebSocket connection is closed. This makes it challenging for me to accurately manage the connection count.

Could you please provide guidance on how to handle this scenario? Specifically, I would like to know:

Is there any way to detect WebSocket connection closures within a Java plugin?
If no direct callback is available, are there alternative approaches or workarounds to achieve this functionality (e.g., leveraging Nginx's internal mechanisms or other APIs)?
Any advice or examples would be greatly appreciated. Thank you for your time and support!

### Environment

- APISIX version (run `apisix version`):
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.