apache / apache/apisix-java-plugin-runner

request help: How to get Spring env value from Docker environment

Offen
#240 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
152
Forks
102
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Issue description
As I know the plugin is based on the Spring framework.
I have configured below in the `application.yaml`:
```yaml
redis:
url: ${REDIS_URL:redis://localhost:6379}
```
Now, I want to set `REDIS_URL` by the docker environment.
Eg:
```yaml
apisix:
container_name: apisix.example.com
image: apisix:3.2.0-debian-javaplugin
volumes:
- ./apisix/conf/config.yaml:/usr/local/apisix/conf/config.yaml
environment:
- REDIS_URL=redis://kimchi:6379
```

- *Expected*: apisix-java-plugin should start succeed with REDIS_URL=redis://kimchi:6379
- *Actual*: apisix-java-plugin can not get REDIS_URL from env

#### My trace
- I ensured when the container started, I could get the correct REDIS_URL by cmd `java -jar my_plugin.jar` (run it directly by hand, not via `ext-plugin.cmd`
- I'm not a Lua developer, but I checked the log, I suspect the Java app maybe run by Lua script, and in this way, the plugin can't get the value from the environment

### Environment
* apisix:3.2.0-debian
* apache-apisix-java-plugin-runner-0.4.0
* Apisix and Apisix Plugin run in the same container
* config.yaml
```yaml
deployment:
role: data_plane
role_data_plane:
config_provider: yaml

ext-plugin:
path_for_test: /tmp/runner.sock
cmd: ['java', '-jar', '-Xmx1g', '-Xms1g', '/usr/local/apisix/token_revoker_plugin.jar']
```

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.