quarkus

How to customly handle Recourse/URLs Not Found in Quarkus?

你。 提交于 2021-01-28 17:49:19
问题 I'm very new to Quarkus and I will like to know how I can override default 404 page which provides the error logs or how I can neatly redirect all not recognized URLs to a custom HTML in the META-INF/recourses directory. 回答1: Using quarkus 0.20+ you can create an ExceptionMapper like this: import java.util.Scanner; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; /** * NotFoundExepptionMapper */

How to customly handle Recourse/URLs Not Found in Quarkus?

北城余情 提交于 2021-01-28 17:41:59
问题 I'm very new to Quarkus and I will like to know how I can override default 404 page which provides the error logs or how I can neatly redirect all not recognized URLs to a custom HTML in the META-INF/recourses directory. 回答1: Using quarkus 0.20+ you can create an ExceptionMapper like this: import java.util.Scanner; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; /** * NotFoundExepptionMapper */

How to customly handle Recourse/URLs Not Found in Quarkus?

女生的网名这么多〃 提交于 2021-01-28 17:40:17
问题 I'm very new to Quarkus and I will like to know how I can override default 404 page which provides the error logs or how I can neatly redirect all not recognized URLs to a custom HTML in the META-INF/recourses directory. 回答1: Using quarkus 0.20+ you can create an ExceptionMapper like this: import java.util.Scanner; import javax.ws.rs.NotFoundException; import javax.ws.rs.core.Response; import javax.ws.rs.ext.ExceptionMapper; import javax.ws.rs.ext.Provider; /** * NotFoundExepptionMapper */

Can’t push to Gitlab registry | Quarkus - Jib build

心已入冬 提交于 2021-01-28 10:22:30
问题 I'm currently developing Quarkus applications and need therefore a CI Pipeline + Container Registry. As containerization through docker isn't working (docker daemon - priviliged mode) I want to use Jib, which is already supported by Quarkus. Command in Pipeline: - mvn clean package -Dquarkus.container-image.push=true -Dquarkus.container-image.registry="https://$registry" -Dquarkus.container-image.username=$username -Dquarkus.container-image.password=$deployToken -Dquarkus.container-image.name

Can’t push to Gitlab registry | Quarkus - Jib build

我与影子孤独终老i 提交于 2021-01-28 10:20:18
问题 I'm currently developing Quarkus applications and need therefore a CI Pipeline + Container Registry. As containerization through docker isn't working (docker daemon - priviliged mode) I want to use Jib, which is already supported by Quarkus. Command in Pipeline: - mvn clean package -Dquarkus.container-image.push=true -Dquarkus.container-image.registry="https://$registry" -Dquarkus.container-image.username=$username -Dquarkus.container-image.password=$deployToken -Dquarkus.container-image.name

Howto obtain a ThreadFactory in Quarkus?

若如初见. 提交于 2021-01-03 07:11:29
问题 I'm trying to migrate a JEE service to Quarkus and wonder how to obtain a thread factory in a Quarkus app. Simply create one like javaExecutors.defaultThreadFactory(); as in JavaSE? In a Java EE environment you would normally use a managed thread factory for creating threads for execution: @Resource private ManagedThreadFactory mtf; Any idea how to do this correctly within a Quarkus app? Addition: Using a ManagedExecutor is unfortunately not possible as some libraries like Apache

Quarkus: how to test secured API endpoints with swagger-ui

霸气de小男生 提交于 2021-01-03 07:08:02
问题 We have a Quarkus application with some secured endpoints. For development and easy testing without much effort, we would like to use Swagger UI as described at https://quarkus.io/guides/openapi-swaggerui. But this seems to only work for unprotected endpoints. Is there a way to also make request to protected endpoints in Swagger UI? 回答1: You need to add a security scheme to your specification: One way to do it is by using annotations: @OpenAPIDefinition(info = @Info(title = "My API", version

Quarkus: how to test secured API endpoints with swagger-ui

拜拜、爱过 提交于 2021-01-03 07:06:31
问题 We have a Quarkus application with some secured endpoints. For development and easy testing without much effort, we would like to use Swagger UI as described at https://quarkus.io/guides/openapi-swaggerui. But this seems to only work for unprotected endpoints. Is there a way to also make request to protected endpoints in Swagger UI? 回答1: You need to add a security scheme to your specification: One way to do it is by using annotations: @OpenAPIDefinition(info = @Info(title = "My API", version

Quarkus: how to test secured API endpoints with swagger-ui

老子叫甜甜 提交于 2021-01-03 07:05:51
问题 We have a Quarkus application with some secured endpoints. For development and easy testing without much effort, we would like to use Swagger UI as described at https://quarkus.io/guides/openapi-swaggerui. But this seems to only work for unprotected endpoints. Is there a way to also make request to protected endpoints in Swagger UI? 回答1: You need to add a security scheme to your specification: One way to do it is by using annotations: @OpenAPIDefinition(info = @Info(title = "My API", version

Quarkus: how to test secured API endpoints with swagger-ui

百般思念 提交于 2021-01-03 07:04:13
问题 We have a Quarkus application with some secured endpoints. For development and easy testing without much effort, we would like to use Swagger UI as described at https://quarkus.io/guides/openapi-swaggerui. But this seems to only work for unprotected endpoints. Is there a way to also make request to protected endpoints in Swagger UI? 回答1: You need to add a security scheme to your specification: One way to do it is by using annotations: @OpenAPIDefinition(info = @Info(title = "My API", version