Skip to content

Commit

Permalink
Graalvm readme touch-up (#1115)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf authored Apr 10, 2024
1 parent 1e0bc90 commit e39f4e9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,18 @@ If you need a snapshot version, you must enable snapshots and change your depend

If you are using the 1.x version of java-nats and don't want to upgrade to 2.0.0 please use ranges in your POM file, java-nats-streaming 1.x is using [1.1, 1.9.9) for this.

### Using GraalVM Example
## Integration with GraalVM

Important GraalVM configurations are `--initialize-at-run-time=io.nats.client.support.RandomUtils`
and `--initialize-at-run-time=java.security.SecureRandom`. These will instruct GraalVM to initialize specified classes
at runtime. So that these instances don't have fixed seeds. GraalVM won't compile without these parameters.
To inlcude this library with a GraalVM project, there are 2 important configurations you must use:
* `--initialize-at-run-time=io.nats.client.support.RandomUtils`
* `--initialize-at-run-time=java.security.SecureRandom`.

Explore the [nats-graalvm-example](https://github.com/YunaBraska/nats-graalvm-example) repository for a straightforward
demonstration on creating efficient NATS clients with GraalVM.
This example leverages the [jNats](https://github.com/nats-io/nats.java) client to connect to a
[NATS test server](https://github.com/YunaBraska/nats-server), which is included within the project.
These will instruct GraalVM to initialize specified classes at runtime, so that these instances don't have fixed seeds.
GraalVM won't compile without these parameters.

For a much more thorough discussion of the subject, please visit the [nats-graalvm-example](https://github.com/YunaBraska/nats-graalvm-example) repository
made by one of our contributors. There is detailed demonstration for creating an efficient NATS clients with GraalVM.
This example leverages the client to connect to a server.

## Basic Usage

Expand Down

0 comments on commit e39f4e9

Please sign in to comment.