//读取以spring.kafka开头配置
@ConfigurationProperties(prefix = "spring.kafka")
public class KafkaProperties {
//设置kafka brokers地址信息
private List bootstrapServers = new ArrayList<>(Collections.singletonList("localhost:9092"));
/**
* ID to pass to the server when making requests. Used for server-side logging.
*/
private String clientId;
/**
* Additional properties, common to producers and consumers, used to configure the
* client.
*/
//一些公共基础信息
private final Map properties = new HashMap<>();
//映射配置文件中spring.kafka.consumer开头属性
private final Consumer consumer = new Consumer();
//映射配置文件中spring.kafka.producer开头属性
private final Producer producer = new Producer();
//映射配置文件中spring.kafka.admin开头属性
private final Admin admin = new Admin();
//映射配置文件中spring.kafka.admin开头属性
private final Streams streams = new Streams();
//映射配置文件中spring.kafka.listener开头属性
private final Listener listener = new Listener();
//映射配置文件中spring.kafka.ssl开头属性
private final Ssl ssl = new Ssl();
//映射配置文件中spring.kafka.jaas开头属性
private final Jaas jaas = new Jaas();
//映射配置文件中spring.kafka.template开头属性
private final Template template = new Template();
......
}
具体详细配置详细可以参照springboot官网
KafkaAutoConfiguration:用于配置初始化kafka依赖bean
@Configuration(proxyBeanMethods = false)
//上下文中必须包含KafkaTemplate类才执行自动装配
@ConditionalOnClass(KafkaTemplate.class)
//将配置文件中哥属性映射到KafkaProperties对象中
@EnableConfigurationProperties(KafkaProperties.class)
//启动KafkaAnnotationDrivenConfiguration,KafkaStreamsAnnotationDrivenConfiguration配置类
@Import({ KafkaAnnotationDrivenConfiguration.class, KafkaStreamsAnnotationDrivenConfiguration.class })
public class KafkaAutoConfiguration {
private final KafkaProperties properties;
public KafkaAutoConfiguration(KafkaProperties properties) {
this.properties = properties;
}
@Bean
//spring上下文中不包含KafkaTemplate类的实例对象时初始化
@ConditionalOnMissingBean(KafkaTemplate.class)
public KafkaTemplate, ?> kafkaTemplate(ProducerFactory
在平时工作中,难免会遇到把 XML 作为数据存储格式。面对目前种类繁多的解决方案,哪个最适合我们呢?在这篇文章中,我对这四种主流方案做一个不完全评测,仅仅针对遍历 XML 这块来测试,因为遍历 XML 是工作中使用最多的(至少我认为)。 预 备 测试环境: AMD 毒龙1.4G OC 1.5G、256M DDR333、Windows2000 Server
Netty 3.x的user guide里FrameDecoder的例子,有几个疑问:
1.文档说:FrameDecoder calls decode method with an internally maintained cumulative buffer whenever new data is received.
为什么每次有新数据到达时,都会调用decode方法?
2.Dec
hive> select * from t_test where ds=20150323 limit 2;
OK
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
问题原因: hive堆内存默认为256M
这个问题的解决方法为:
修改/us
Simply do the following:
I. Declare a global variable:
var markersArray = [];
II. Define a function:
function clearOverlays() {
for (var i = 0; i < markersArray.length; i++ )
Quick sort is probably used more widely than any other. It is popular because it is not difficult to implement, works well for a variety of different kinds of input data, and is substantially faster t