spring-cloud-dataflow - 如何在 Spring Cloud 数据流中将 gemfire 配置为聚合器模块的消息存储
问题描述
链接 - https://github.com/spring-cloud-stream-app-starters/aggregator/tree/master/spring-cloud-starter-stream-processor-aggregator未列出 gemfire 消息存储的属性
解决方案
配置GemfireMessageStore
如下:
@ConditionalOnClass(GemfireMessageStore.class)
@ConditionalOnProperty(prefix = AggregatorProperties.PREFIX,
name = "message-store-type",
havingValue = AggregatorProperties.MessageStoreType.GEMFIRE)
@Import(ClientCacheAutoConfiguration.class)
static class Gemfire {
@Bean
@ConditionalOnMissingBean
public ClientRegionFactoryBean<?, ?> gemfireRegion(GemFireCache cache, AggregatorProperties properties) {
ClientRegionFactoryBean<?, ?> clientRegionFactoryBean = new ClientRegionFactoryBean<>();
clientRegionFactoryBean.setCache(cache);
clientRegionFactoryBean.setName(properties.getMessageStoreEntity());
return clientRegionFactoryBean;
}
@Bean
public MessageGroupStore messageStore(Region<Object, Object> region) {
return new GemfireMessageStore(region);
}
}
关键是你总是可以ClientRegionFactoryBean
用你自己的来覆盖它。或者您可以考虑ClientCacheAutoConfiguration
基于. 包括配置和池。没错:它不在应用程序启动器配置级别,您必须将一些自定义代码作为依赖项包含到目标绑定器特定应用程序的最终 uber jar 中。@ClientCacheApplication
ClientCacheConfigurer
有关如何构建它们的更多信息,请参见 Docs:https ://docs.spring.io/spring-cloud-stream-app-starters/docs/Einstein.RC1/reference/htmlsingle/#_patching_pre_built_applications
推荐阅读
- javascript - Chrome浏览器版本72.0.3626.96 bug触发从 javascript 函数中单击(文件选择对话框)
- sql - 检查表行值时返回单个值
- wpf - ItemsCollection 的 ContainerFromItem 对于我很确定在集合中的对象失败
- php - 当语句在 MySQL 中正常工作时,如何修复 PHP 中的语法错误?
- angular - Angular Observable异步管道?
- javascript - 为什么在使用日期对象创建日期时收到“'日期'类型的参数不可分配给'字符串|数字'类型的参数”?
- tensorflow.js - 全卷积网络
- angular - 更新 mat-select 动态反应形式中的选项
- sql - 在 SQL 插入时,将新行的分配 ID 写入第二列
- excel - VBA中的if else循环中是否有if else循环?