Skip to content
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

NUID generate same consumers names for native compiled executable #1260

Open
Andro999b opened this issue Dec 6, 2024 · 2 comments
Open

NUID generate same consumers names for native compiled executable #1260

Andro999b opened this issue Dec 6, 2024 · 2 comments
Labels
proposal Enhancement idea or proposal

Comments

@Andro999b
Copy link

Proposed change

Reflect in DOCS that io.nats.client.NUID should be initialized at runtime as well:

--initialize-at-run-time=io.nats.client.NUID

Use case

Native compiled executables.

Contribution

No response

@Andro999b Andro999b added the proposal Enhancement idea or proposal label Dec 6, 2024
@Andro999b Andro999b changed the title NUID generate the same consumers names for native compiled executable NUID generate same consumers names for native compiled executable Dec 6, 2024
@scottf
Copy link
Contributor

scottf commented Dec 6, 2024

@Andro999b Are you sure, because it depends on RandomUtils, which is already identified in the readme. Maybe it's a Quarkus specific thing?

  • Is it the are static things in the NUID class that are problematic?
  • Would just saying initialize at runtime for the NUID cover RandomUtils since it's a dependency?
  • Have you verified the consumer names are identical? It could be that they are very similar and may only differ in the last character.

@Andro999b
Copy link
Author

Andro999b commented Dec 9, 2024

@scottf I'm pretty sure about this. I have updated my previous reproducer so you can check it: https://github.com/Andro999b/nats-java-native-build-reproducer

Don't know if this Quarkus specific or not. But NUID have static global instance that will be initialized at build time by default (This can be checked in GraalVM class initilization report target/native-build-1.0.0-SNAPSHOT-native-image-source-jar/reports). Call to the RandomUtils(initialized at runtime) does not matter here because GraalVM does inline methods during compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Enhancement idea or proposal
Projects
None yet
Development

No branches or pull requests

2 participants