microprofile | microprofile - embeddable CPU/GPU profiler | Monitoring library
kandi X-RAY | microprofile Summary
kandi X-RAY | microprofile Summary
This is a fork of microprofile by Jonas Meyer. This library has diverged from upstream and is developed independently, with no intention to merge in either direction. microprofile is an embeddable CPU/GPU profiler with an in-app and HTML visualizers.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of microprofile
microprofile Key Features
microprofile Examples and Code Snippets
Community Discussions
Trending Discussions on microprofile
QUESTION
When MicroProfile LRA coordinator and participants run on different Docker containers, it is needed to define a custom URI for each participant.
Otherwise the LRA coordinator tries to call participant compensate/complete APIs by referring them with "localhost" based URI.
Is it possible, on WildFly environment, to define a custom URI for a participant? And ingeneral is it possible to define a how participants can register with any LRA?
...ANSWER
Answered 2022-Apr-12 at 12:03By default, the participant endpoints are derived from the caller information provided in the JAX-RS UriInfo
class. This class contains the base URI of the caller of the participant. The idea is that coordinator should be able to call the participant on the same URI as the original request to the participant came in.
I've created a simple docker image https://hub.docker.com/repository/docker/xstefank/uriinfo-wildfly which will on path /uriinfo/ping
return the the base URI that will be used for participant URLs.
Calling this locally gives you - Base URI is http://localhost:8080/uriinfo/
which is expected called from the local machine. Deploying this image to OpenShift/Kubernetes and exposing a route for this application gives you Base URI is http://uriinfo-wildfly-testing.6923.rh-us-east-1.openshiftapps.com/uriinfo/
. And finally, calling it from a different pod deployed in the same project gives you Base URI is http://uriinfo-wildfly:8080/uriinfo/
which corresponds to the actual calls:
QUESTION
Quarkus' Kafka-Streams extension provides a convenient way to start a pipeline. Necessary configuration options for the stream application, e.g., quarkus.kafka-streams.bootstrap-servers=localhost:9092
must be inserted in the application.properties
file for the encompassing project.
Quarkus also provides a pass-through option for a finer configuration. The documentation states:
All the properties within the kafka-streams namespace are passed through as-is to the Kafka Streams engine. Changing their values requires a rebuild of the application.
With that, we can for example pass-through a custom timestamp extractor (or any other configuration property that related to the streams configuration)
...ANSWER
Answered 2022-Apr-11 at 14:58You can just pass it using standard configuration for consumers and producers, prefixed with kafka-streams:
QUESTION
I'm just starting to explore openliberty, so maybe there is something trivial I did not see.
The project is generated by https://openliberty.io/start/ with java version 17, jakarta ee 9.1 and microprofile 5.0 options.
environment:
- open liberty: 22.0.0.3
- jdk: OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 17.0.2+8-jvmci-22.0-b05)
- maven: 3.8.5
ANSWER
Answered 2022-Apr-03 at 08:26For the time being (see environment info in the question) mvn liberty:dev
throws an error if maven.compiler.source
or maven.compiler.target
is used together with maven.compiler.release
even if the version numbers are aligned. So you either have to use
maven.compiler.source
and/ormaven.compiler.target
withoutmaven.compiler.release
ormaven.compiler.release
withoutmaven.compiler.source
and/ormaven.compiler.target
If you are working in a maven-multi-module project where the above properties were defined in parent modules you can workaround this issue by overriding the properties appropriately.
QUESTION
i'm currently upgrading from Wildfly 20 to Wildfly 26. The standalone.xml
doesn't start, because of an Injection of MetricRegistry
and the newly missing microprofile.metrics-smallrye
-extension (already described under: MicroProfile Metrics do not show custom metrics on Wildfly 25).
But if i start the standalone-microprofile.xml
or add the extensions (see CLI-commands below), i ran into the same error.
Maybe the Keycloak-Integration-Workaround is conflicting. The Wildfly-internal OIDC adapter is actualy not working in bearer-only-mode. So i installed the current keycloak-client (keycloak-oidc-wildfly-adapter-16.1.1
) an the workaround (see as last code-template).
ANSWER
Answered 2022-Feb-23 at 09:04Oh i spend a couple of hours to get rid of this problem.. but only minutes after writing this post, i found the "bad guy".
The Microprofile Version 3.3 (on Wildfly 20) ignored annotations (like @Timed
) at interface-methods. The new Version 4.1 (Wildfly 26) regards them..
pretty easy, afterwards :)
marginal note:
If you have more than one WAR deployed on your Wildfly and one of them is using the public API of an other one, then you'll run into problems with hot-deployments.
I assume, in my case it occurs because i have placed the Timed
-annotation at the implementation-class and not at the interface, that is used as ResteasyClient-proxy. Every time i deploy the depending WAR after the rest-api-defining WAR, i got an exception: no metric mapped
.
A redeployment of the rest-api-defining WAR fixes this issue :)
QUESTION
On Docker Image open-liberty:22.0.0.1-full-java17-openj9 with the following activated features:
...ANSWER
Answered 2022-Feb-14 at 14:26The problem here is that the API and SPI bundles that start with io.openliberty have not been publishing to DHE and maven as part of the Liberty publishing tasks that run when a new version is released. We are looking to have this resolved with 22.0.0.2 which is scheduled to be available tomorrow if we don't run into any additional snags and the io.openliberty publishing goes well.
QUESTION
I have a maven project with two modules : core and webapp. The webapp module is a war file to be deployed to wildfly. It has a dependency to the core module.
I can run mvn clean package
in the parent directory of my modules. I am able to deploy de war file manually to wildfly and it works. Unfortunately if I run mvn wildfly:deploy
in the webapp directory I get :
ANSWER
Answered 2022-Feb-09 at 19:53You need to run mvn install
, or the artifact for the core
module is built but never installed into the local repository and cannot be resolved when building the webapp
module.
QUESTION
The following error is given when I try to deploy a simple app (the default one that IntelliJ provides when you create a new Java EE Web App project):
...ANSWER
Answered 2022-Feb-08 at 19:36You are using Java 16 (as shown in the log file) with Maven. In this case, you should use TomEE in version 8.0.9 as this release contains important fixes regarding illegal reflective access (due to the use of Unsafe for proxy creation) in higher versions of Java. You find some details in https://issues.apache.org/jira/browse/TOMEE-3795
It looks like you are using a lower Java version for running your standalone TomEE deployment, which works as it isn't as restrictive as newer Java versions.
Side Note: Java 16 is end-of-life and you should better switch to Java 17.
QUESTION
I use wildfly-25.0.1.Final. I can't test the microprofile-health quickstart :
...ANSWER
Answered 2022-Feb-07 at 17:56It looks like there was a bug filed for this, but it was fixed in WildFly 25. That said I do not see the reference in the default README.
That said it does require the standalone-microprofile.xml
. You can also add the subsystem with CLI to standalone.xml
and runt it that way as well. The following CLI commands will add the microprofile-health-smallrye
to any configuration you start with that does not already include the subsystem.
QUESTION
When changing to Quarkus 2.6.2.Final I suddenly run into: org.eclipse.microprofile.faulttolerance.exceptions.CircuitBreakerOpenException
(circuit breaker is open) when running (unit / integration) test annotated with @QuarkusTest
.
I changed other stuff except the Quarkus baseline, so I don't know for sure the update is the sole cause.
...ANSWER
Answered 2022-Jan-18 at 15:51This is not caused by the update, Quarkus 2.6.2.Final did not change anything regarding the fault tolerance stuff.
To facilitate negative testing, you can inject CircuitBreakerMaintenance
and reset all circuit breakers in the application using resetAll
(see https://smallrye.io/docs/smallrye-fault-tolerance/5.2.1/usage/extra.html#_circuit_breaker_maintenance).
Alternatively, there's a configuration property that disables all fault tolerance except fallbacks: MP_Fault_Tolerance_NonFallback_Enabled
(see https://download.eclipse.org/microprofile/microprofile-fault-tolerance-3.0/microprofile-fault-tolerance-spec-3.0.html#_disable_a_group_of_fault_tolerance_annotations_on_the_global_level).
QUESTION
I'm a C developer who needs to create a basic async REST server (synchronous version works fine) in Java using the Microprofile (Helidon MP) framework. Here is my strategy to do this:
The client should do the POST call and provide JSON objects that the POST endpoint will receive. Then, the POST Endpoint method will call a business logic that should do stuff with the received JSON objects. This logic must be run asynchronously. POST should immediately return 202 Accepted. The client should check for async task completion status using a GET request (simple pooling style).
Should POST return a URI that the GET call will use? How? This GET should also provide the percentage of the task completion if the task is in progress. Finally, if the business logic is done, the GET should return the result.
I have a little previous experience with async Java, but no experience with async in this Microprofile/Java EE/Jakarta or whatever it is. I tried several different approaches (AsyncResponse, CompletitionStatus, etc.) to write this code (async POST Method) but nothing seems to be working. The skeleton of the POST functions looks like this:
...ANSWER
Answered 2021-Dec-23 at 22:10So, first things first. To run things asynchronously Jakarta EE has the annotation @Asynchronous
. So, create a CDI bean with @RequestScoped
, and put there your business method annotated with @Asynchronous
.
Add @ApplicationScoped
CDI annotation to your JAXRS service so you can inject ypur business bean.
Then, for monitoring the task, you have a couple of possibilities.
If you keep the state in a database you just make the
@GET
method to check the state in the database. But I asume this is not your case.If the first approach doesn't fit then you have to keep the state of the different inProgress tasks somehow. I would have another
@ApplicationScoped
CDI bean for that. This would contain aConcurrentHashMap
, with aUUID
as the key, and as the value an Object of your own that contains the current state of any specific async job.
The UUID
has to be generated in the @POST
method, and sent as a parameter to the @Asynchronous
, method. This way the @POST
method can return the UUID
, which will be used then in the @GET
to request the state of the task (querying the @ApplicationScoped
bean).
So the application-wide async tasks state holder should be something like this
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install microprofile
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page