我正在努力在代理后面使用 oauth2 正确设置 webflux-weblient 。
看来, ServerOAuth2AuthorizedClientExchangeFilterFunction 使用 webclient 的新实例,它不包含我的代理配置。
OAuth2-配置
ServerOAuth2AuthorizedClientExchangeFilterFunction oauth2ClientFilter = new ServerOAuth2AuthorizedClientExchangeFilterFunction(
clientRegistrations,
new UnAuthenticatedServerOAuth2AuthorizedClientRepository());
oauth2ClientFilter.setDefaultClientRegistrationId("azure");
Run Code Online (Sandbox Code Playgroud)
OAuth2AuthorizedClientResolver.class 包含:
private ReactiveOAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest> clientCredentialsTokenResponseClient = new WebClientReactiveClientCredentialsTokenResponseClient();
Run Code Online (Sandbox Code Playgroud)
创建WebClientReactiveClientCredentialsTokenResponseClient.java一个新的 Web 客户端,如下所示:
private WebClient webClient = WebClient.builder().build();
有人有如何为 oauth2 客户端正确设置 http 代理的示例吗?
我正在使用 Maven 插件 avro-maven-plugin (1.9.2) 从 AVRO-schema-file (avsc) 生成 Java 类。我定义一个日期字段如下:
{
"name": "inceptionDate",
"type": "int",
"logicalType": "date"
}
Run Code Online (Sandbox Code Playgroud)
我面临的问题是,它生成一个int而不是Date或LocalDate。
private int inceptionDate;
Run Code Online (Sandbox Code Playgroud)
pom.xml配置定义如下:
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>1.9.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<dateTimeLogicalTypeImplementation>JSR310</dateTimeLogicalTypeImplementation>
<sourceDirectory>${project.basedir}/src/main/resources/schema/</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-sources/main/java/</outputDirectory>
<stringType>String</stringType>
<fieldVisibility>PRIVATE</fieldVisibility>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
有什么想法吗,有什么问题吗?