kandi X-RAY | smallrye-context-propagation Summary
kandi X-RAY | smallrye-context-propagation Summary
SmallRye implementation of MicroProfile Context Propagation
Top functions reviewed by kandi - BETA
- Creates a snapshot of the current context .
- Called after a bean has been instantiated .
- Wrap the current thread context .
- Obtain the transaction manager
- Applies a contextual supplier to the plan .
- Take a thread context snapshot of this thread context .
- Makes a new context snapshot of the current thread s context classloader .
- Creates a set of contexts from an array of strings .
- Migrates t .
- Execute a command
smallrye-context-propagation Key Features
smallrye-context-propagation Examples and Code Snippets
Trending Discussions on smallrye-context-propagation
I just wanted to try dev services for spinning up a config free postgres in docker as I read at https://quarkus.io/guides/datasource#dev-services-configuration-free-databases
Generated a quarkus project https://code.quarkus.io/ with dependency
and application.properties looks like
ANSWERAnswered 2022-Mar-09 at 23:51
According to your warning message, there's one extension missing for this configuration:
I have a Quarkus project that expose some REST Endpoints. When working on dev mode or running from the local build docker container all work fine, those endpoints annotated with @RolesAllowed and @PermitAll work as supposed to be. But when I deploy to a AWS service with the following steps:
- Commit to Gitlab
- Run Gitlab CICD
- Send result with the config to an AWS S3 Bucket
- Trigger AWS codepipeline
- Deploy to Elastic Bean using docker image
After that the container is deployed all endpoints with @PermitAll work fine but those with @RolesAllowed responds with 401 Unauthorized, the token sent to those endpoints is valid, it is correctly formed and has not expired....
ANSWERAnswered 2021-Oct-27 at 03:20
The problem was the AWS time zone configuration, for some strange reason it interfered with how Quarkus validates the IAT and EXP claims of the token. I removed the AWS time zone settings and set the zone using a system property at the JVM level and the problem was completely fixed.
I'm trying to use Quarkus and JDBI — not so many examples on this out there I would say :/
The Gradle script has these dependencies:...
ANSWERAnswered 2021-Sep-24 at 19:52
yes , it works with AgroalDataSource
I started a project and have about 7 tests in my project now and it takes already more than a minute to execute the whole test suite using
From the additional output (
--info flag) I can see that the whole quarkus application and also dependencies like the mongodb instance are restarted for every test class and method.
This is the exact opposite of what the quarkus documentation says on the testing guide page:
So far in all our examples we only start Quarkus once for all tests. Before the first test is run Quarkus will boot, then all tests will run, then Quarkus will shutdown at the end. This makes for a very fast testing experience however it is a bit limited as you can’t test different configurations.
All the tests are annotated with
@QuarkusTest and every test just tests a single endpoint.
I use "pure" kotlin (1.5.21), Quarkus version 2.2.2.Final and gradle 6.9. Installed features: cdi, config-yaml, jacoco, kotlin, mongodb-client, mongodb-panache-kotlin, narayana-jta, rest-client, rest-client-jackson, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, smallrye-openapi, swagger-ui
Is that a normal behaviour? If yes, an application with multiple hundred tests could easily take ~20 minutes or more to run the entire test suite.
I didn't try out maven yet, so I can't verify that it's not a gradle related issue....
ANSWERAnswered 2021-Sep-23 at 07:49
While trying to reproduce it with a fresh project, I think I found the issue with my code:
I also used
restrictToAnnotatedClass=true on my tests.
This means the configuration & test profiles must be reloaded and therefore also the quarkus application.
Apparently all the DevServices get restarted, too (in my case it was a mongodb, since I'm using the panache extension), which explains the long runtimes of the tests.
I reorganized my tests a little bit, so they work with the "global" test resources (it was a
WireMockServer in my case).
Now quarkus only gets started once before the tests and the total runtime of the gradle test task is acceptable.
I created a simple quarkus lambda rest project as described in the documentation...
ANSWERAnswered 2021-Sep-01 at 14:31
After digging through the quarkus sources, I found a similar integration test example. After comparing this with my code I found one difference in the
All my applications written in Quarkus/Java can't be accessed in localhost:8000 exposed in dev mode when running inside WSL 2....
ANSWERAnswered 2021-Jul-28 at 05:10
From my project's root directory, I issued the following command to create a native executable that will be specific to my operating system. See the following guide for details...
ANSWERAnswered 2021-Jun-23 at 20:34
The documentation explains that
-Dquarkus.native.container-build=true option means that you want to build a Linux executable and that the build should happen in a container.
You can even control the runtime for that Docker/Podman with:
I created a new Quarkus app using the following command:...
ANSWERAnswered 2021-Jun-15 at 15:18
Please enable the quarkus-smallrye-jwt TRACE logging to see why the tokens are rejected.
And indeed, as you have also found out,
https protocol needs to be enabled in the native image, which can be done, as you have shown :-), by adding
--enable-url-protocols=https to the native profile's properties in
This PR will ensure adding it manually won't be required.
WARN [io.qua.hib.orm.dep.HibernateOrmProcessor] Could not find a suitable persistence unit for model classes:
The same issue with both
My project has multiple named persistent units and datasources (no default). I'm also using multitenant feature.
INFO [io.quarkus] Installed features: [agroal, cache, cdi, config-yaml, hibernate-orm, hibernate-orm-panache-kotlin, jdbc-mysql, kotlin, mutiny, narayana-jta, resteasy, resteasy-jackson, security, smallrye-context-propagation, smallrye-jwt, smallrye-openapi, swagger-ui, vertx, vertx-web]
ANSWERAnswered 2021-Jun-09 at 01:34
It seems that the ORM processor doesn't exclude those base entities, and tries to attach them to a non-existent "default" persistent units. Hence the warning.
I could get rid of it by either define "default" PU or assign
io.quarkus.hibernate.orm.panache.kotlin to a named one.
I have created a test project where I have combined two guides: Quarkus-DynamoDB and Quarkus-HTTP lambda. The end goal of this was to have an example project where a lambda communicates with DynamoDB, and this is all compiled natively (using GraalVM).
This has worked relatively well. I managed to deploy the project to AWS lambda using the tools from the second guide, and the responses I get when calling the endpoints are as expected.
However, I have some questions about the performance, particularly after a startup.
When hitting the simple "hello" endpoint from the first guide, the times look like this:...
ANSWERAnswered 2021-May-11 at 09:09
The first call to a "new" Lambda instance takes longer because it has to be initialised. This is also referred to as cold start.
Check the following two lines of your second output example:
No vulnerabilities reported
You can use smallrye-context-propagation like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the smallrye-context-propagation component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Reuse Trending Solutions
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page