本文整理汇总了Java中org.springframework.kafka.support.serializer.JsonSerializer类的典型用法代码示例。如果您正苦于以下问题:Java JsonSerializer类的具体用法?Java JsonSerializer怎么用?Java JsonSerializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsonSerializer类属于org.springframework.kafka.support.serializer包,在下文中一共展示了JsonSerializer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: producerConfigs
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public Map<String, Object> producerConfigs() {
Map<String, Object> props = new HashMap<>();
// list of host:port pairs used for establishing the initial connections to the Kakfa cluster
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return props;
}
开发者ID:corydissinger,项目名称:mtgo-best-bot,代码行数:11,代码来源:BotOrchestratorApplication.java
示例2: producerConfigs
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public Map producerConfigs() {
Map<String, Object> props = new HashMap<>();
props.put("bootstrap.servers",
env.getProperty("kafka.broker"));
props.put("key.serializer",
StringSerializer.class);
props.put("value.serializer",
JsonSerializer.class);
props.put("linger.ms", 1);
return props;
}
开发者ID:sarojrout,项目名称:spring-tutorial,代码行数:14,代码来源:StudentProducerConfig.java
示例3: producerConfigs
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
public Map<String, Object> producerConfigs() {
Map<String, Object> props = new HashMap<>();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, brokers);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return props;
}
开发者ID:rozidan,项目名称:project-template,代码行数:8,代码来源:KafkaConfig.java
示例4: producerFactory
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public ProducerFactory<String, Foo> producerFactory() {
Map<String, Object> props = new HashMap<>();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, this.configProperties.getBrokerAddress());
props.put(ProducerConfig.RETRIES_CONFIG, 0);
props.put(ProducerConfig.BATCH_SIZE_CONFIG, 16384);
props.put(ProducerConfig.LINGER_MS_CONFIG, 1);
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return new DefaultKafkaProducerFactory<>(props);
}
开发者ID:SpringOnePlatform2016,项目名称:grussell-spring-kafka,代码行数:13,代码来源:JsonConfiguration.java
示例5: producerFactory
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public ProducerFactory<String, AvMessage> producerFactory() {
Map<String, Object> configProps = new HashMap<>();
configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return new DefaultKafkaProducerFactory<>(configProps);
}
开发者ID:dvoraka,项目名称:av-service,代码行数:10,代码来源:KafkaFileClientConfig.java
示例6: fileServerProducerFactory
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public ProducerFactory<String, AvMessage> fileServerProducerFactory() {
Map<String, Object> configProps = new HashMap<>();
configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return new DefaultKafkaProducerFactory<>(configProps);
}
开发者ID:dvoraka,项目名称:av-service,代码行数:10,代码来源:KafkaServerConfig.java
示例7: producerConfigs
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public Map<String, Object> producerConfigs() {
Map<String, Object> props = new HashMap<>();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
return props;
}
开发者ID:code-not-found,项目名称:spring-kafka,代码行数:10,代码来源:SenderConfig.java
示例8: lifecycleEventSerializer
import org.springframework.kafka.support.serializer.JsonSerializer; //导入依赖的package包/类
@Bean
public JsonSerializer lifecycleEventSerializer() {
return new JsonSerializer<>(objectMapper());
}
开发者ID:corydissinger,项目名称:mtgo-best-bot,代码行数:5,代码来源:BotOrchestratorApplication.java
注:本文中的org.springframework.kafka.support.serializer.JsonSerializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论