Skip to content

Commit

Permalink
Workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
rogervinas committed Jul 17, 2024
1 parent b87866e commit bc29466
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.rogervinas.stream.functional

import com.fasterxml.jackson.databind.ObjectMapper
import com.rogervinas.stream.domain.MyEvent
import com.rogervinas.stream.domain.MyEventConsumer
import com.rogervinas.stream.shared.MyEventPayload
import org.springframework.cloud.function.json.JacksonMapper
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Primary
import org.springframework.messaging.Message
import reactor.core.publisher.Flux


@Configuration
class MyConfiguration {
@Bean
Expand All @@ -27,4 +31,11 @@ class MyConfiguration {

@Bean("my-producer")
fun myStreamEventProducerFunction(producer: MyStreamEventProducer): () -> Flux<Message<MyEventPayload>> = producer

@Bean
@Primary
fun jacksonMapper(objectMapper: ObjectMapper): JacksonMapper {
// Workaround for https://github.com/spring-cloud/spring-cloud-function/issues/1158
return JacksonMapper(objectMapper)
}
}

0 comments on commit bc29466

Please sign in to comment.