[英]Micronaut @SerdeImport annotation not working with Kotlin
我正在使用 Micronaut 框架和 Kotlin 語言開發應用程序。 但是,我面臨的問題是,在將 Micronaut 與 Kotlin 一起使用時,@SerdeImport 注釋無法被識別。即使在使用 @SerdeImport 注釋后,我仍然遇到錯誤。 相同的注釋在使用 Java 時工作正常, ...
[英]Micronaut @SerdeImport annotation not working with Kotlin
我正在使用 Micronaut 框架和 Kotlin 語言開發應用程序。 但是,我面臨的問題是,在將 Micronaut 與 Kotlin 一起使用時,@SerdeImport 注釋無法被識別。即使在使用 @SerdeImport 注釋后,我仍然遇到錯誤。 相同的注釋在使用 Java 時工作正常, ...
[英]Write custom authentication function in Micronaut
在 Micronaut 中,我有一個非常基本的要求。 我只想解碼 JWT 令牌並檢查聲明 map 中是否存在一個密鑰。我還沒有遇到我們只是驗證令牌的任何實現。 我已經實現了自定義身份驗證提供程序,但在調試 API 時返回 401 而不是 go 進入身份驗證 function。 應用.yml co ...
[英]How to write a byte array to a cloud destination using Micronaut?
我正在將一個小的 Spring 方法轉換為 Micronaut。 此方法的目的是將字節數組寫入雲中的目的地。 為了識別目的地,URI 作為參數傳遞給 Spring 方法。 這是使用 Spring 的實現: 基於這個問題,我知道 Micronaut 沒有org.springframework.cor ...
[英]How to set OpenApi config via code and not using annotation in Micronaut
我有一個 springboot 應用程序,我想轉換為 Micronaut,但是我如何通過代碼配置 openapi,就像在這篇文章中一樣 https://keepgrowth.in/java/springboot/how-to-secure-spring-boot-swagger-ui-with-b ...
[英]How to create a Micronaut project with JPA Entity from external classes from another jar
我有一個 Micronaut 項目,我正在嘗試使用我的外部實體類構建項目,這些類位於 Spring JPA 中,添加了 pom.xml 中的依賴項,但我總是遇到錯誤: Caused by: io.micronaut.context .exceptions.ConfigurationException ...
[英]Problem with bean instantiation using @Repository micronaut data annotation
我正在接近 Micronaut 框架來創建一個與數據庫交互的程序。 我是 gradle 項目配置等的新手,所以這可能是與此相關的問題。 我將我的項目分為兩個模塊:main(Application 類所在的位置)和 masterdata(所有項目所在的位置) 在“masterdata”模塊中,我有 ...
[英]Methods signature got changed while compiling the gradle java application and referencing to other project
我有兩個項目( Common和ApiGateway )。common 是 Gradle java 項目,ApiGateway 是 Micronaut java 應用程序。 在 common 項目中,我保留了所有常見的東西並將 jar 引用到 Apigateway 項目。 共同項目 下面的代碼是用. ...
[英]Mapped the Yaml configuration to Micronaut swagger open API security configuration
我有以下用於 OAuth 的 YAML 配置 還有一個用於映射如下內容的記錄類 現在在 micronaiut 應用程序的主要方法中,我需要映射記錄值,不知道如何實現這一點 ...
[英]Configuring default micronaut httpClient properties using ConfigurationProperties
我正在 Micronaut 中編寫一個 java 庫模塊,它有一個 httpClient。 我的想法是我的微服務將使用此庫作為 jar 依賴項並使用 httpClient。 問題陳述:我想在不使用application.yml的情況下配置我的 HttpClient。 為什么我不想使用 applica ...
[英]How to pass the value to the AuthenticationProvider from HttpRequest in Micronaut java with Jnunit 5
使用 Micronaut HttpClient 執行 Junit 5 測試中的 HTTP 調用。 我正在嘗試使用 HttpRequest 將值傳遞給 AuthenticationProvider,如下所示 這里我將屬性設置為request.setAttribute("fb_product", "o ...
[英]Authentication null with JUnit 5 testing Micronaut 3.3.4
嘗試使用 JUnit 測試通過 micronaut 安全保護 controller,獲得身份驗證為 NULL。 身份驗證提供者 Controller定義 安全規則 在安全規則中,檢查方法Authentication authentication是 null。但是,從身份驗證提供程序,我已成功進行 ...
[英]Micronaut Random Port fails to start Tests
我維護了一個相當大的 micronaut 應用程序,進行了數千次測試。 最近我遷移到 Azure 並開始看到這些帶有此錯誤的不穩定測試 應用程序-test.yml 示例測試 我看不出 micronaut 選擇用於 random.port 的端口的任何明顯原因,或者為什么這只是在遷移到 A ...
[英]Micronaut doesn't return default HTTP error representation for Flux return types
我有簡單的 Micronaut controller 和 2 個類似的GET方法,它們返回不同的反應類型。@Controller public class MyController { @Get(uri = "/a", produces = MediaType.APPLICATIO ...
[英]Spring's @WebMvcTest equivalent in micronaut
我如何才能在@MicronautTest 中僅運行 controller 而無需像在 spring @WebMvcTest中那樣僅運行存儲庫/服務 mocking 它們? @RestController @RequestMapping("/api") public class ...
[英]Rest end point unit testing using JWT token validation in Micronaut
使用 micronaut 創建受 micronaut-jwt 安全保護的 rest 端點 安全 model 安全規則 上述端點作為聲明owner 、 creator和maintainer受到保護我正在使用身份服務器 4 ( https://github.com/IdentityServer/Iden ...
[英]Validate model from other module with micronaut gives "No bean introspection present."
當我嘗試在 POST 方法的主體中將 object 發送到 micronaut 應用程序時,我得到: model:無法驗證 com.example2E5559B870688ZE9050B87068 不存在 bean 自省。 請將@Introspected 添加到 class 並確保啟用 Micro ...
[英]Micronaut-Core: How to create dynamic endpoints
簡單的問題。 是否可以在沒有@Endpoint的情況下創建端點? 我想通過文件並根據其上下文的內容創建相當動態的端點。 謝謝! 更新我的想法。 我想創建一個插件系統之類的東西,以使我的應用程序更易於維護和未來的功能。 值得一提的是,我正在使用帶有 Kotlin 的 Micronaut。 現在我有固定 ...
[英]Adding headers to incoming request in Micronaut filters
我正在編寫一個服務,目前,它需要實現自己的 JWT 令牌驗證。 這稍后將由服務之前的層處理。 為此,我打算使用HttpServerFilter接口攔截請求: @Filter(Filter.MATCH_ALL_PATTERN) public class SecurityFilter implemen ...
[英]How do I disable the http server in a micronaut application
我有一個 micronaut 應用程序,它應該在一個容器中運行 SQS 偵聽器,在另一個容器中運行常規 HTTP 服務器。 如何通過配置實現此目的? 我可以使用以下應用程序屬性來啟用/禁用偵聽器: 如何啟用/禁用 web 服務器? PS:我能夠在 spring 啟動時使用spring.main.w ...
[英]Streaming file blocks event loop?
micronaut 2.0.1 中的一個項目有一個 function 來公開一些資源。 該資源通過 HTTP 從另一個服務通過 InputStream 流式傳輸。 不幸的是,應用程序重新啟動,因為健康端點返回的速度不夠快。 通過 inte.net 返回文件時, StreamedFile是否有可能 ...