Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:57

    olegz on 3.1.x

    GH-2202 Remove Reflection calls… (compare)

  • 11:52

    olegz on main

    GH-2202 Remove Reflection calls… (compare)

  • Jul 22 15:57
    olegz commented #2068
  • Jul 22 14:47
    antonywhatever commented #2068
  • Jul 20 13:54

    olegz on 3.1.x

    Fix supplier test (compare)

  • Jul 20 13:38

    olegz on 3.1.x

    Fix failing test (compare)

  • Jul 20 13:20

    olegz on 3.1.x

    Fix failing test (compare)

  • Jul 20 11:14

    olegz on 3.1.x

    Temporarily disable failing test (compare)

  • Jul 20 08:58

    olegz on 3.1.x

    Temporarily disable failing test (compare)

  • Jul 20 08:46

    olegz on 3.1.x

    Temporarily disable failing test (compare)

  • Jul 20 08:30

    olegz on 3.1.x

    Bump s-c-build to 3.0.4-SNAPSHOT (compare)

  • Jul 20 03:57
    velovint commented #1404
  • Jul 16 13:27
    olegz commented #2196
  • Jul 16 13:26

    olegz on 3.1.x

    GH-2196 Enhance test case to de… (compare)

  • Jul 16 13:25

    olegz on main

    GH-2196 Enhance test case to de… (compare)

  • Jul 16 08:04

    olegz on 3.1.x

    Bump timeout on randomly failin… (compare)

  • Jul 16 08:04

    olegz on main

    Bump timeout on randomly failin… (compare)

  • Jul 16 08:01

    olegz on 3.1.x

    Fix test (compare)

  • Jul 16 07:59

    olegz on main

    Fix test (compare)

  • Jul 15 18:08
    samragu commented #2194
Iulia Iancu
@iulia-iancu
The producer app creates the exchange pips.from-crawler that appears in rabbitmq UI. However the consumer app does not create a queue and bind it to pips.from-crawler
I tried to search online after the issue but I can't find any hint. I don't understand why the consumer app does not create the queue. Do you have any ideas about what I can do to solve the problem? Thank you!
3 replies
Bohdan Korinnyi
@BohdanKorinnyi

Hi, does anybody have an example how can I send message using SCS to different kafka topics that are not known in advance and received by HTTP call?

I found that it's easy to implement using KafkaTemplate and Kafka_Topic header but what's the approach with SCS?

4 replies
Iulia Iancu
@iulia-iancu
image.png
PJ
@pjiocnic
Can anyone please give me an example for Knative eventing + AWS SQS using spring cloud stream?
Iulia Iancu
@iulia-iancu
consumer:
Ivan
@ismorodin
I get infinite loop when throws MessageHandlingException and consumer working in batch mode
image.png
image.png
Andras Hatvani
@andrashatvani
hey, apparently EmitterProcessor has been deprecated in reactor 3.4 in favor of reactor.core.publisher.Sinks
i use the former as event producer, but i’m not sure how to implement the latter and i don’t see any reference to it in the spring cloud stream docs either - any relevant hint would be appreciated.
3 replies
jesrzrz
@jesrzrz
Hi, I'm having some issues with the ' InvalidStateStoreException: The state store, xxxxxxx , may have migrated to another instance'. This state store was working fine till today, when a new version of its producer was deployed. There are two instances of the producer in a kubernetes cluster and now, only one of both can connect to the state store. The point of fail is located in a QueryableStoreProvider.getStore method. I have increased the parameteres of the retry template, but it didn't fixed it. Any idea about this kind of behaviour? Thanks
Iheb Ben Romdhane
@iheb090
hello everyone ,
i want to create a message to multiple topic with a single producer
in the docs i found the branching method but it works with processor and not producer
there's a way to apply branching on supplier for exemple ??
Viacheslav Petriaiev
@Viacheslav-Petriaiev

Hello
I have the problem which is described at reactor/reactor-core#2145
I have the flux which is connected to the RabbitMQ topic. In case when the new message is processed by my flow and use the MongoDB I got the described exception.
What is the best way to stay connected with flux to the RabbitMQ when the error occurs without onErrorContinue usage?
I have my library for that:

                .onErrorContinue { th, causeElement ->
                    logger.error("Cause element: $causeElement, message: ${th.message}", th)
                }
                .doOnError { t: Throwable ->
                    logger.error(t.message ?: "Cause exception message is null", t)
                }
                .retry()

How onErrorContinue can be avoided for such a case?

Thank you

yaboong
@yaboong

Hello, I'm using spring-cloud-stream kafka binder with schema registry. (not kakfa streams)
What I'm trying to do is when un-deserializable message has got into an input topic, send the un-deserializable message to dlq.

So I tried like below but spring cloud stream app keeps retrying infinitely and says

Caused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1

What am I doing wrong? Please help.

spring.cloud.stream:
  function:
    definition: functionName
  bindings:
    functionName-in-0:
      group: group-name
      destination: input-topic
  kafka:
    binder:
      brokers: localhost:9092
    bindings:
      functionName-in-0:
        consumer:
          enableDlq: true
          dlqName: input-topic-dlq
          autoCommitOnError: true
          autoCommitOffset: true
    default:
      consumer:
        configuration:
          schema.registry.url: http://localhost:8081
          key.deserializer: org.apache.kafka.common.serialization.StringDeserializer
          value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
6 replies
yaboong
@yaboong

@garyrussell
sorry for asking a lot, but how to make onlyLogRecordMetadata=true work?
I did exactly the same like this (https://github.com/spring-projects/spring-kafka/issues/1659#issuecomment-749025910)

@Component
class Customizer {

    Customizer(AbstractKafkaListenerContainerFactory<?, ?, ?> factory) {
        factory.getContainerProperties().setOnlyLogRecordMetadata(true);
    }

}

but when deserialization failed, it still prints all unrecognizable value like this

SeekToCurrentErrorHandler        : Backoff none exhausted for ConsumerRecord(topic = chat, partition = 0, leaderEpoch = 0, offset = 26, CreateTime = 1613666130733, serialized key size = -1, serialized value size = 4, headers = RecordHeaders(headers = [RecordHeader(key = springDeserializerExceptionValue, value = [-84, -19, 0, 5, .....so many values......., 69, 111, 114, 10])], isReadOnly = false), key = null, value = null)

In the ListenerUtils, it always goes to the else block even though I set exactly the same as you mentioned.

public static String recordToString(ConsumerRecord<?, ?> record) {
    if (Boolean.TRUE.equals(LOG_METADATA_ONLY.get())) {
        return record.topic() + "-" + record.partition() + "@" + record.offset();
    }
    else {
        return record.toString();
    }
}
2 replies
yaboong
@yaboong

Hello! I'm trying to use RetryTemplate and retry when an exception (specifically RedisException) occurred in message handling.
But when the exception has been thrown while handling messages, all the exceptions are caught in AbstractMessageHandler.

And then it wraps all the exceptions to MessageHandlingException in IntegrationUtils.

So there's no way for RetryTemplate to distinguish which exception specifically has been thrown. Because of this, I can't apply RetryTemplate's "retryOn" or "notRetryOn" method (I mean it doesn't work). Am I doing it wrong? there's another way to handle this? Please help.

2 replies
yaboong
@yaboong

In document 1.3.3. Consuming Batches it says

Retry within the binder is not supported when using batch mode, so maxAttempts will be overridden to 1

Does this mean that using retry-template-name: someRetryTemplateBean is not supported?

6 replies
D3jank
@D3jank

Hello, I've upgraded our app to spring boot 2.4.3 from 2.3.6 to use aws secrets manager spring.config.import=aws-secretsmanager:<secret>. It is a cloud stream app that uses Kafka. App works fine on 2.4.3, but when I add the spring.config.import, I get the following:
java.lang.IllegalStateException: Could not register object [com.amazonaws.services.secretsmanager.AWSSecretsManagerClient@5323b690] under bean name 'configDataAWSSecretsManager': there is already object [com.amazonaws.services.secretsmanager.AWSSecretsManagerClient@5323b690] ...

Any idea how to fix that?

happyangel
@happyangel:matrix.org
[m]
Hello, I have a spring-cloud-stream application that uses destination-is-pattern to listen to a dynamic set of Kafka topics. This works fine when I have one instance of the application running. When I start another instance of the application with the same consumer group id, it starts up fine, but remains idle. No messages get routed to the second instance of the application. I'm wondering if it is related to using the destination-is-pattern.
Following is my sanitized configuration
spring:
    cloud:
        function:
            definition: process1;process2
        stream:
            bindings:
                input1:
                    binder: kafka
                    destination: abc.* #Topic pattern to listen on
                    group: group1
                input2:
                    binder: kafka
                    destination: def.* #Topic pattern to listen on
                    group: group2
            function:
                bindings:
                    process1-in-0: input1
                    process2-in-0: input2
            kafka:
                binder:
                    brokers: localhost:9092
                    configuration:

                        application:
                            id: appid

                bindings:
                    input1:
                        consumer:
                            destination-is-pattern: true
                            auto-commit-offset: false
                    input2:
                        consumer:
                            destination-is-pattern: true
                            auto-commit-offset: false
happyangel
@happyangel:matrix.org
[m]
Its probably because I only have one partition per topic, which results in one-consumer per topic.
10 replies
René Schröder
@reneschroeder0000
Hi, is it possible to provide the kafka value-deserializer on the binding level?
spring.cloud.stream.bindings.my-input-binding.consumer-properties.value-deserializer = ... # this doesnt work
spring.cloud.stream.kafka.binder.consumer-properties.value-deserializer = ... # this works but i would prefer to put it within the binding configuration
3 replies
Aditya Parikh
@adityaparikh91087

Running a SCS Kafka Streams app against topics that I have required to change in course of local development.
The app keeps logging
ConsumerCoordinator : [Consumer clientId=-app--StreamThread-1-consumer, groupId=branching-kstreams-app] We received an assignment [topicA-0, topicA-2] that doesn't match our current subscription Subscribe(topicB); it is likely that the subscription has changed since we joined the group. Will try re-join the group with current subscription INFO --- [-StreamThread-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=branching-kstreams-app-StreamThread-1-consumer, groupId=branching-kstreams-app] (Re-)joining group

and does not progress beyond that. How to address this?
I have changed the application id as well as deleted the state store changelog topics, changed the input topics and this does not seem to go away.

blake-bauman
@blake-bauman
Is there a way to have multiple, parallel Kafka Consumers when using a Flux? I'd like to handle each partition in parallel. I tried using spring.cloud.stream.bindings.input.consumer.concurrency=3 but got an error: Concurrency > 1 is not supported by reactive consumer, given that project reactor maintains its own concurrency mechanism.
Iheb Ben Romdhane
@iheb090
hello everyone
can i activate the consumer on batch mode in kafka streams binder ??
3 replies
happyangel
@happyangel:matrix.org
[m]
That fixed it! Many thanks Gary. I'll test out all my scenarios.
pranavvr1992
@pranavvr1992

Hi,

I have an issue with Spring cloud stream url. I am launching my spring cloud tasks from spring cloud stream. Stream contains http-kafka as source and taskLauncerKafka as sink. I used http-kafka service url to launch tasks. kubernetes service url changes after each deployment. First deployment the service name be like sample-stream-v1 after second deployment it will be sample-stream-v2. I am using kubernetes platform. So I have used kubernetes service urls to launch the tasks. The changes in the service name after each stream deployment is difficult to manage. I have tried enabling loadbalacer also. In that case also external ip address changed after each stream rollout. Any solutions ?

Iheb Ben Romdhane
@iheb090
hello everyone ,
can i activate dead letter queue (dlq) with a consumer on batch-mode with kafka binder ??
1 reply
Igor Rudenko
@fac30ff
hi, I have a question about spring cloud stream kafka streams, how to setup source topic? because it always assigned partition as bindings: name but my producer produce to specific topic
10 replies
Marcus Mosttler
@mmosttler_gitlab

Hello all,
We had been using the EmitterProcessor in projects that used the Supplier to publish a message. But now after upgrading one of them to use Springboot 2.4.3 and Spring Cloud 2020.0.1 I noticed that the EmitterProcessor has been Deprecated with notes to use Sinks instead. So I have modified the code to use the Sinks and still produce the same Message as before with key and value.

My Issue is that with the Sinks when publishing the Message with a header for message key it fails to publish. If I remove the key header it publishes just without a key. I am not sure what I am missing or if there is a more appropriate way to implement the Supplier now.

@Configuration
public class BrandConfigPublisher
{
    @Bean
    public Supplier<Flux<Message<MyBean>>> myBeanSupplier()
    {
        return () -> sinkBeanProducer().asFlux();
    }

    @Bean
    public Consumer<MyBean> sinkBeanPublisher(Sinks.Many<Message<MyBean>> sinkMyBeanProducer)
    {
        return myBean -> sinkBeanProducer
            .emitNext(
                MessageBuilder.withPayload(myBean)
                    .setHeader(KafkaHeaders.MESSAGE_KEY, myBean.getName())
                    .build(),
                Sinks.EmitFailureHandler.FAIL_FAST
            )
        ;
    }

    @Bean
    public Sinks.Many<Message<MyBean>> sinkMyBeanProducer()
    {
        return Sinks.many().multicast().onBackpressureBuffer();
    }
}

Any help is greatly appreciated

Igor Rudenko
@fac30ff
hello again: as I understand aggregate; reduce and count same things by nature. But I need specific aggregator so I want to use own processor, and I findout method on KStream process that receive as supplier processor, but this method return void so it is terminal. So how I can use functional style if I need to process Kstream and than read from my store in the same function?
1 reply
yaboong
@yaboong

Hello!
The document says (same for the consumer)

The following properties are only available for Kafka Streams producers and must be prefixed with spring.cloud.stream.kafka.streams.bindings.<binding name>.producer. For convenience, if there multiple output bindings and they all require a common value, that can be configured by using the prefix spring.cloud.stream.kafka.streams.default.producer.

so I tried using it like below but it doesn't work.

spring.cloud.stream.kafka.streams.default.consumer.keySerde=org.apache.kafka.common.serialization.Serdes$StringSerde
spring.cloud.stream.kafka.streams.default.consumer.valueSerde=io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde
spring.cloud.stream.kafka.streams.default.producer.keySerde=org.apache.kafka.common.serialization.Serdes$StringSerde
spring.cloud.stream.kafka.streams.default.producer.valueSerde=io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde

this works

spring.cloud.stream.kafka.streams.binder.configuration.default.key.serde=org.apache.kafka.common.serialization.Serdes$StringSerde
spring.cloud.stream.kafka.streams.binder.configuration.default.value.serde=io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde

Is there anyone who's having the same issue?

René Schröder
@reneschroeder0000
Hi. I am using scs functional style with kafka binding. Is there any way to pause/resume the input binding at runtime?
2 replies
terancet
@terancet
Hello! Encountered the problem that newly created Kafka consumer group cannot read messages from the existing topic. At the production, we have the topic with the 12 partitions and 7 weeks retention policy. We are using the latest version of the Spring Cloud Stream Binder Kafka Streams (Hoxton.SR10). When we deploy the new consumer group, the the following exceptions happen in the consumers for that new consumer group: TimeoutException: Failed to send request after 30000 ms and DisconnectException: null and, they don't consumer any messages from the topic.
Could anybody point me the right direction for the further investigation?
terancet
@terancet
Also, should I check the the configuration property auto.offset.reset and set its value to earliest in order to consume messages from the first offset commit?
Gary Russell
@garyrussell
I suggest DEBUG logging for org.apache.kafka. It will automatically be set to earliest if the binding has a group property. You can see the ConsumerConfig in the INFO log emitted by the kafka-clients.
Anonymous
@keirjames

Hello everybody! Quick & easy question from me:
Is it possible to use Spring Cloud Stream w/ Kafka Streams Binder to consume as a KStream from one Kafka Broker, and produce the KStream to a different Kafka Broker?

ie/ BrokerA -> Application -> BrokerB

Thanks!

5 replies
pedrorlmarques
@pedrorlmarques
Hello, I'm using spring cloud stream Kafka binder 3.1.0, and I'm facing a behaviour that I don't know if it's normal or not.
I have the following configuration ackMode: MANUAL_IMMEDIATE and also I configured the DLQName and enableDlq to true.
The use case is the following:
1- The listener receives a message and processes it with success and acknowledges it.
2- The listener receives a message that it throws an exception and sends directly to the DLQ and i'm assuming that automatically acknowledges it.
3- The listener receives a message and processes it with success acknowledges it.
4 - In the end if i check the spring.cloud.stream.binder.kafka.offset metrics the value is 0 but then immediately it changes to 2.
The consumer doesn't process these 2 unconsumed messages until I restart the consumer or upon successfully processing a message.
Is this a valid behaviour?
24 replies
Kevin Lewis
@kevinrlewis
Hello, I'm running into an issue using spring-cloud-stream kafka with jasypt spring boot starter. I'm showing that when I start my application regardless of what my application does it starts sending configProps to kafka to a configPropsSingleton-out-0 topic. Is there any way to disable this? Seems like there is some connection with spring integration invoking the message to be send: bean 'configPropsSingleton_integrationflow.router#0'. Let me know if I need to provide more information.
25 replies
eplouhinec
@eplouhinec
Hello! I'm trying to add management of correlationId in my @StreamListener methods which listen kafka events. I use headers to put correlationId in it. Then, in ly listener, I read this header value and put it in MDC. At the end of the method, I remove it from MDC.
I'm not convinced by robustness of this system. Furthermore, I have to do it on each @StreamListener method which is very redundant. Do you have some tips to give to me? AOP is the only way to factorize this?
Swethaa Ramesh
@swethaaramesh_twitter
Hello, I'm trying to develop an application that uses a @StreamListener interface and calls different classes to handle the event based on a header... I'm trying to test this using Mocks but unable to do so.. are there any testing examples with mocks ?
4 replies
ashevade1
@ashevade1
Hi I am using the cloud stream kafka binder , version 3.0.1.RELEASE. I am trying to fetch the RecordMetadata when a message is published. I am not clear on the documentation, when it says it can be achieved by specifying the 'recordMetadaçtaChannel' which is bean to which the record metadata is sent. Does anyone have any samples of how to do this. Thanks.
jay
@legendjaks

I would like to run my consumers in different thread.

Environment:
- springBoot: 2.4.4
- springCloud: 2020.0.2
- springCloudStream: 3.1.1

Configuration:

spring:
  cloud:
    stream:
      bindings:
        createProduct-in-0:
          destination: create_product
          group: playground-service
      function:
        definition: createProduct
      kafka:
        binder:
          brokers: localhost:9092
          autoAddPartitions: true
          configuration:
            num.stream.threads: 2
        bindings:
          createProduct-in-0:
            consumer:
              concurrency: 2

but still all consumers run in one single thread,

2021-03-20 19:17:31.161  INFO [playground-service,03b04f0d730a9a76,768bacebed1187e6] 37454 --- [container-0-C-1] c.p.stream.CreateProductHandler  : Received ProductDto(id=null, name=iPhone 8)
2021-03-20 19:17:49.212  INFO [playground-service,57f8ece5553f7aeb,fcf5651f72f43e44] 37454 --- [container-0-C-1] c.p.stream.CreateProductHandler  : Received ProductDto(id=null, name=Galaxy A1)

any configuration missing?

2 replies
verified that these 2 messages are from different partition
Hau Van
@redondoxx
This message was deleted
7 replies
Hau Van
@redondoxx
Hi guys, when i declare the producer and the consumer in the same Spring Application, spring boot not firing the message to kafka, but the consumer still receive the message, why is it?
Swethaa Ramesh
@swethaaramesh_twitter
Hi, quick question, if I want to listen on a topic that may have different event types, can I use a generic object in the @StreamListener interface, something like this :
@StreamListener(ChannelBindings.inTopic)
public void handle(@Headers MessageHeaders headers, @Payload Object event),
Or would we need to specify the exact type for conversion
5 replies
antunonline
@antunonline

Hi, I'm having trouble running demo code for Kafka Streams Spring integration as documented in https://spring.io/blog/2019/12/02/stream-processing-with-spring-cloud-stream-and-apache-kafka-streams-part-1-programming-model.
Once I start the application I always get the following exception:

Caused by: java.lang.IllegalArgumentException: 'listener' cannot be null
    at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.3.5.jar:5.3.5]
    at org.springframework.kafka.config.StreamsBuilderFactoryBean.addListener(StreamsBuilderFactoryBean.java:268) ~[spring-kafka-2.6.7.jar:2.6.7]
    at org.springframework.cloud.stream.binder.kafka.streams.StreamsBuilderFactoryManager.start(StreamsBuilderFactoryManager.java:84) ~[spring-cloud-stream-binder-kafka-streams-3.1.2.jar:3.1.2]
    ... 13 common frames omitted

By looking at the code the exception is related to KafkaStreamsMicrometerListener begin null, but this class is not mentioned in mentioned documentation.
Is anybody familiar with this problem?

1 reply