seninel部署
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Sentinel Quarkus Adapter
  2. Sentinel provides `sentinel-annotation-quarkus-adapter` and `sentinel-jax-rs-quarkus-adapter` to
  3. adapt [sentinel-annotation-cdi-interceptor](https://github.com/alibaba/Sentinel/tree/master/sentinel-extension/sentiel-annotation-cdi-interceptor)
  4. and [sentinel-jax-rs-adapter](https://github.com/alibaba/Sentinel/tree/master/sentinel-adapter/sentinel-jax-rs-adapter) for Quarkus.
  5. The integration module also provides `sentinel-native-image-quarkus-adapter` to support running Sentinel with Quarkus in native image mode.
  6. To use sentinel-jax-rs-quarkus-adapter, you can simply add the following dependency to your `pom.xml`:
  7. ```xml
  8. <dependency>
  9. <groupId>com.alibaba.csp</groupId>
  10. <artifactId>sentinel-jax-rs-quarkus-adapter</artifactId>
  11. <version>x.y.z</version>
  12. </dependency>
  13. ```
  14. To use sentinel-annotation-quarkus-adapter, you can simply add the following dependency to your `pom.xml`:
  15. ```xml
  16. <dependency>
  17. <groupId>com.alibaba.csp</groupId>
  18. <artifactId>sentinel-annotation-quarkus-adapter</artifactId>
  19. <version>x.y.z</version>
  20. </dependency>
  21. ```
  22. When Quarkus application started, you can see the enabled feature like:
  23. ```
  24. INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy, sentinel-annotation, sentinel-jax-rs]
  25. ```
  26. ## For Quarkus native image
  27. If you want to integrate Quarkus with Sentinel while running in native image mode,
  28. you should add the following dependency to your `pom.xml`:
  29. ```xml
  30. <dependency>
  31. <groupId>com.alibaba.csp</groupId>
  32. <artifactId>sentinel-native-image-quarkus-adapter</artifactId>
  33. <version>x.y.z</version>
  34. </dependency>
  35. ```
  36. And then add `--allow-incomplete-classpath` to `quarkus.native.additional-build-args`.
  37. If you're using `sentinel-jax-rs-quarkus-adapter`, you'll need to set `quarkus.native.auto-service-loader-registration` to true.
  38. When Quarkus application started, you can see the enabled feature like:
  39. ```
  40. INFO [io.quarkus] (main) Installed features: [cdi, resteasy, sentinel-annotation, sentinel-jax-rs, sentinel-native-image]
  41. ```
  42. For more details you may refer to the `pom.xml` of [sentinel-demo-quarkus](https://github.com/alibaba/Sentinel/tree/master/sentinel-demo/sentinel-demo-quarkus).
  43. ### Limitations
  44. `sentinel-native-image-quarkus-adapter` currently relies on `sentinel-logging-slf4j` to help Sentinel
  45. run in native image mode easily, because `quarkus-core` provides `Target_org_slf4j_LoggerFactory` to substitute `getLogger` method.
  46. Currently `sentinel-transport-simple-http` can work in native image mode, while `sentinel-transport-netty-http` cannot work in native image mode without extra config or substitutions.
  47. ## References for build native image or AOT
  48. - [Quarkus - Tips for writing native applications](https://quarkus.io/guides/writing-native-applications-tips)
  49. - [Quarkus - Class Loading Reference](https://quarkus.io/guides/class-loading-reference)
  50. - [SubstrateVM LIMITATIONS](https://github.com/oracle/graal/blob/master/substratevm/LIMITATIONS.md)
  51. - [Accessing resources in Substrate VM images](https://github.com/oracle/graal/blob/master/substratevm/RESOURCES.md)