Skip to content

Commit

Permalink
add a short documentation #140
Browse files Browse the repository at this point in the history
  • Loading branch information
zsdoma committed Jan 17, 2025
1 parent 5f07cd7 commit 6fd48a9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/en/services/filewatcher.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
= FileWatcher service
`sample/sample-filewatcher-service`

The purpose of this service is to demonstrate how to read configuration and track its changes from a plane properties file using `java.nio.file.WatchService`.

Before using this service, must be specified the directory where the properties file located outside of the container and the path where the file located
inside the container. For this, the `docker-compose.local.wildfly.yml` compose file must be changed as follow:

* `CONFIG_PROPERTIES_FILE_PATH` environment variable define the properties file path inside the container
** `CONFIG_PROPERTIES_FILE_PATH: /home/customConfig/config.properties` (this is the default value)
* the directory of the properties file must be mounted to the container
** `./customConfig:/home/customConfig'`
1 change: 1 addition & 0 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include::services/grpc.adoc[leveloffset=+2]
include::services/mongo.adoc[leveloffset=+2]
include::services/kafka.adoc[leveloffset=+2]
include::services/etcd.adoc[leveloffset=+2]
include::services/filewatcher.adoc[leveloffset=+2]
include::services/jpa-batch.adoc[leveloffset=+2]

== Infrastruktúra példák
Expand Down
13 changes: 13 additions & 0 deletions docs/services/filewatcher.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
= FileWatcher service
`sample/sample-filewatcher-service`

A service célja annak bemutatása, hogy hogyan lehet konfigurációt felolvasni, illetve annak változását is követni, properties fájlból a
`java.nio.file.WatchService` segítségével.

A service használata előtt a properties fájl megtalálásához meg kell adni annak a konténeren kívüli mappáját, illetve a properties fájl konténeren belüli
elérését, amihez a `docker-compose.local.wildfly.yml` compose fájlt ki kell egészíteni az alábbiak szerint:

* CONFIG_PROPERTIES_FILE_PATH környezeti változóban meg kell adni a konténeren belüli elérési útját a properties fájlnak
** `CONFIG_PROPERTIES_FILE_PATH: /home/customConfig/config.properties` (ez az alapértelmezett érték)
* a properties fájl tartalmazó mappát fel kell csatolni a konténerhez, mint Docker volume, mivel a fájl változás követés mappán keresztül lehetséges
** `./customConfig:/home/customConfig'`

0 comments on commit 6fd48a9

Please sign in to comment.