spring-cloud-stream

Spring cloud streams could not autowire Source.class

痴心易碎 提交于 2020-02-02 15:42:50
问题 I am learning Spring Cloud Streams from scratch. I tried to create a Source application like this: import org.springframework.cloud.stream.messaging.Source; //etc @RestController @SpringBootApplication @CrossOrigin @EnableBinding(Source.class) public class StreamsProducerApplication { @Autowired Source source; @GetMapping(value="/send/{message}") public void sendMessage(@PathVariable String message){ if(message != null){ source.output().send(MessageBuilder.withPayload(message).build());} }

Spring Cloud Stream multiple function definitions

北城以北 提交于 2020-01-25 08:03:26
问题 Is it possible to have reactive SCS application using functional ( spring.cloud.function ) style with multiple, separate functions / bindings? All examples I have found always register only one functional bean with default bindings input, output . I would like to register multiple, each with its own bindings. Traditionally this could be done using spring-cloud-stream-reactive but it is now deprecated in favor of functional support. 回答1: Yes, it is possible in the latest snapshot and we'll be

jackson cannot deserialize (spring cloud stream kafka)

≯℡__Kan透↙ 提交于 2020-01-23 09:14:07
问题 I am trying to read a json message from kafka and got an exception, which says Jackson cannot deserialize the json to POJO. The json is like {"code":"500","count":22,"from":1528343820000,"to":1528343880000} , which is an output of kafka stream. The POJO declares all attributes of the json, and is exactly the same POJO to produce the json message. So I have no idea why it would happen. I am using spring cloud stream 2.0.0.RELEASE. Any help would be appreciated. Thanks. POJO: public class

LoadBalancing Spring cloud data flow server

不打扰是莪最后的温柔 提交于 2020-01-17 06:52:34
问题 In spring cloud dataflow, as per my understanding each stream is a microservice but the dataflow server is not. Am I right? Is it possible to have multiple instances of spring cloud dataflow(SCDF) server? How to loadbalance the dataflow server? I am planning to deploy it in AWS.The official documentation didn't mention anything about loadbalancing of dataflow server. If it is possible how do Dashboard, shell works? 回答1: The SCDF-server is a regular Spring MVC + Spring Boot application that

How to use “Kafka Streams Binder” with “Functional Style” and DI?

徘徊边缘 提交于 2020-01-16 18:20:14
问题 https://cloud.spring.io/spring-cloud-static/spring-cloud-stream-binder-kafka/3.0.0.M3/reference/html/spring-cloud-stream-binder-kafka.html#_programming_model shows an example where the input topic can be set using the property spring.cloud.stream.bindings.process_in.destination . Now I want to use dependency injection, e.g. @Bean public java.util.function.Consumer<KStream<Object, String>> process(JavaMailSender mailSender) {...} When starting the application (based on Spring Boot) the

Spring cloud config + bus calls twice to the config server when the binder is created

╄→гoц情女王★ 提交于 2020-01-15 17:44:01
问题 I have created a simple project using spring-cloud-config and spring-cloud-bus. For some reason, the config client calls twice to the config server. The first time happens when the context of the bootstrap is created (what is the expected behaviour) but the second time is called when the context of the binder is created. This is done In the class: DefaultBinderFactory#getBinderInstance: // If the environment is not customized and a main context is available, we // will set the latter as

Spring cloud config + bus calls twice to the config server when the binder is created

强颜欢笑 提交于 2020-01-15 17:39:09
问题 I have created a simple project using spring-cloud-config and spring-cloud-bus. For some reason, the config client calls twice to the config server. The first time happens when the context of the bootstrap is created (what is the expected behaviour) but the second time is called when the context of the binder is created. This is done In the class: DefaultBinderFactory#getBinderInstance: // If the environment is not customized and a main context is available, we // will set the latter as

Spring cloud config + bus calls twice to the config server when the binder is created

ⅰ亾dé卋堺 提交于 2020-01-15 17:39:06
问题 I have created a simple project using spring-cloud-config and spring-cloud-bus. For some reason, the config client calls twice to the config server. The first time happens when the context of the bootstrap is created (what is the expected behaviour) but the second time is called when the context of the binder is created. This is done In the class: DefaultBinderFactory#getBinderInstance: // If the environment is not customized and a main context is available, we // will set the latter as

How to use RMQ and spring cloud stream for creating partition based producer?

无人久伴 提交于 2020-01-15 04:55:15
问题 I am trying to find example of spring cloud stream where it creates parition based producer for RMQ. I want to see how it will create binding for those queues as RMQ not natively support paritions for topic but it will create number of queues equivalent to number of partitions (I read this,I may be wrong). First I want to understand how to create producer using spring cloud stream on RMQ for partition based producer. 回答1: @SpringBootApplication @EnableBinding(Source.class) public class

Spring Cloud Kafka Stream Unable to create Producer Config Error

人盡茶涼 提交于 2020-01-12 05:24:49
问题 I have two Spring boot project with Kafka-stream dependencies, they have exactly same dependencies in gradle and exactly same configurations, yet one of the project when started logs error as below 11:35:37.974 [restartedMain] INFO o.a.k.c.admin.AdminClientConfig - AdminClientConfig values: bootstrap.servers = [192.169.0.109:6667] client.id = client connections.max.idle.ms = 300000 metadata.max.age.ms = 300000 metric.reporters = [] metrics.num.samples = 2 metrics.recording.level = INFO