我已将Oracle SQL开发人员工具中的数据库导出到.sql文件中.现在我想运行这个大小超过500 MB的文件.
我在这里阅读了关于运行脚本的内容,但我不明白这种方式.是否有任何命令或查询可以通过提供路径来运行此sql脚本?
我们使用 spring security oauth2 使用客户端凭据授予类型来获取令牌。我们不使用该application.properties
文件来指定客户端凭据,而是以编程方式提供它们。
ClientRegistration clientRegistration = ClientRegistration
.withRegistrationId("test")
.clientId("testclientid")
.clientSecret("testclientsecret")
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)
.tokenUri("http://test.tokenuri.com")
.build();
ReactiveClientRegistrationRepository reactiveClientRegistrationRepository = new InMemoryReactiveClientRegistrationRepository(clientRegistration);
ServerOAuth2AuthorizedClientExchangeFilterFunction oauth =
new ServerOAuth2AuthorizedClientExchangeFilterFunction(
reactiveClientRegistrationRepository,
new UnAuthenticatedServerOAuth2AuthorizedClientRepository());
oauth.setDefaultClientRegistrationId("test");
this.webClient = webClientFactory.getBuilder()
.filter(oauth)
.build();
Run Code Online (Sandbox Code Playgroud)
该代码工作正常,但我们看到一条已UnAuthenticatedServerOAuth2AuthorizedClientRepository
弃用的警告。api 文档UnAuthenticatedServerOAuth2AuthorizedClientRepository
建议使用AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager
,但AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager
没有实现与UnAuthenticatedServerOAuth2AuthorizedClientRepository
. 在这种情况下,对于替换已弃用的内容有何建议UnAuthenticatedServerOAuth2AuthorizedClientRepository
?
我找到了https://github.com/spring-projects/spring-security/issues/8016但该问题没有提供太多细节。
我正在将应用程序从 Spring Boot 1.x 迁移到 2.x,我在 logback 配置中发现了一些使用 a 的条目LevelRemappingAppender
,如下所示:
<appender name="DEBUG_LEVEL_REMAPPER" class="org.springframework.boot.logging.logback.LevelRemappingAppender">
<destinationLogger>org.springframework.boot</destinationLogger>
</appender>
Run Code Online (Sandbox Code Playgroud)
org.springframework.boot.logging.logback.LevelRemappingAppender
Boot 2 中不存在,我在迁移指南中找不到替代品或任何提及。
有没有一种简单的方法可以在 Spring Boot 2 中包含这个 Logback 重映射功能?
我想将Mongeez与我的Spring Boot应用程序集成,并想知道如何在应用程序启动期间正确运行Mongeez.Mongeez 建议创造一个MongeezRunner
豆子.但是,挑战是在任何Spring Data初始化发生之前运行Mongeez,特别MongoTemplate
是在创建实例之前.这一点至关重要,因为数据库中可能存在阻止应用程序启动的更改(例如,更改索引定义).
我目前的方法是自己提供MongoTemplate bean,在创建之前运行Mongeez:
@Bean
public MongoTemplate mongoTemplate(Mongo mongo, MongoDbFactory mongoDbFactory,
MongoConverter converter) throws IOException {
// make sure that Mongeez runs before Spring Data is initialized
runMongeez(mongo);
return new MongoTemplate(mongoDbFactory, converter);
}
private void runMongeez(Mongo mongo) throws IOException {
Mongeez mongeez = new Mongeez();
mongeez.setMongo(mongo);
mongeez.setDbName(mongodbDatabaseName);
mongeez.setFile(new ClassPathResource("/db/migrations.xml"));
mongeez.process();
}
Run Code Online (Sandbox Code Playgroud)
它有效,但感觉就像一个黑客.有没有其他方法可以做到这一点?