Questions tagged [spring-cloud-stream]

Spring Cloud Stream allows a user to develop and run messaging microservices using Spring Integration and run them locally, or in the cloud, or even on Spring Cloud Data Flow. Just add @EnableBinding and run your app as a Spring Boot app (single application context). You just need to connect to the physical broker for the bus, which is automatic if the relevant bus implementation is available on the classpath.

Use this tag for questions about the Spring Cloud Stream project. It is not intended for general questions about integrating other Spring projects with other technologies.

Spring Cloud Stream's Official Project Site

Spring Cloud Stream's Github Repo

How to contribute

Related tags , , .

2724 questions
8
votes
2 answers

Kafka Consumer metrics gone upon upgrade from Spring Boot 2.2.2 to 2.3.0

Problem: We upgraded our Spring Boot version from 2.2.2 to 2.3.0, and all of the kafka_consumer_* metrics that were seen in the Prometheus endpoint in 2.2.2 are not visible in 2.3.0. For example, all of the below are…
8
votes
2 answers

How can I disable spring cloud stream for development purpose when there are not kafka broker running?

I have multiples spring boot apps implementing spring cloud stream with kafka brokers. I'd like to know if I can stop or disable spring cloud stream or kafka broker connections to enable apps to start.
8
votes
1 answer

How can I map incoming headers as String instead of byte[] in my Spring Cloud Stream project?

I have a simple Spring Cloud Stream project using Spring Integration DSL flows and using the Kafka binder. Everything works great, but message header values coming from Kafka arrive as byte[]. This means that my SI @Header parameters need to be of…
8
votes
1 answer

Spring Cloud Kafka Stream Unable to create Producer Config Error

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 …
8
votes
1 answer

spring-cloud-stream kafka consumer concurrency

With spring-cloud-stream's kafka binder, how do you configure concurrent message consumers (in a single consumer jvm)? If I understand correctly, having concurrent message consumption when using kafka requires partitions, but the s-c-s docs indicate…
gadams00
  • 771
  • 1
  • 10
  • 24
7
votes
1 answer

Understanding Spring Cloud Stream Kafka and Spring Retry

I have a Spring Cloud Stream project using the Kafka binder and I'm trying to understand and eventually customize the RetryTemplate used by Cloud Stream. I'm not finding a lot of documentation on how this works, but what I've read leads me to the…
7
votes
2 answers

Spring Cloud Function - Separate routing-expression for different Consumer

I have a service, which receives different structured messages from different message queues. Having @StreamListener conditions we can choose at every message type how that message should be handled. As an example: We receive two different types of…
Danny
  • 166
  • 1
  • 9
7
votes
1 answer

Difference between @KafkaListener, @StreamListener and @ServiceActivator?

I want to use Kafka with Spring Boot and with Avro schemas. But I'm stucked on 'What is the difference between those 3 listeners?'. There are 3 possibilities to create listeners: annotate a method with - @KafkaListener, @StreamListener or…
Kamil Zieliński
  • 357
  • 6
  • 13
7
votes
3 answers

How to disable spring cloud stream binding for develop purposes?

I need to disable publication and subscription on events for development, but I can't find some configuration properties/other solution for this. How can I do this? Possible solution: to create autoconfiguration with @EnableBinding on some property…
injecto
  • 829
  • 1
  • 10
  • 23
7
votes
1 answer

Spring Cloud Stream Kafka consumer patterns

For a topic with multiple partitions - 1) Does a single SpringBoot instance use multiple threads to process (method annotated with StreamListener) each message from each partition? 2) Is it possible to configure more than one thread for each…
Ajay
  • 465
  • 1
  • 9
  • 22
6
votes
1 answer

How to instrument Spring Boot 3.x with Spring Cloud Stream 4.x producers and consumers to correlate tracing information in loggers

After upgrading to Spring Boot 3 I've had to update the tracing/correlation configuration to switch from Spring Cloud Sleuth to the new Micrometer Tracing library. At this point I can see traceId/spanId information in the logs, which is correctly…
6
votes
1 answer

Why StreamListener is deprecated

I am using Spring Cloud Stream 3.1.2 for KafkaStreams. The programming models are: Functional Programming Imperative Programming The latter one uses annotations as all the other annotations that the Spring is provided to be used. But, it is…
6
votes
1 answer

How to make Spring Cloud Stream consumer in Webflux application?

I have a Webflux based microservice that has a simple reactive repository: public interface NotificationRepository extends ReactiveMongoRepository { } Now I would like to extend this microservice to consume event…
6
votes
0 answers

Spring Cloud Stream Kafka Multiple Binding

I am using Spring Cloud Stream Kafka binder to consume messages from Kafka. I am able to make my sample work with a single Kafka Binder as below spring: cloud: stream: kafka: binder: consumer-properties:…
6
votes
1 answer

Extremely slow startup of a Spring Cloud Stream Kafka application when using enable.idempotence true

My Scs application has two Kafka producers with this configuration: spring: cloud: function: definition: myProducer1;myProducer2 stream: bindings: myproducer1-out-0: destination: topic1 producer: …