Skip to content

Bindings endpoint doesn't works when SpEL expression is configured #3104

@ferblaca

Description

@ferblaca

Describe the issue
The bindings endpoint actuator doesn't works when a binding is configured with a expression. for example:

spring: 
  cloud:
    stream:
      kafka:
        bindings:
          foo-out-0:
            producer:
              message-key-expression: headers['kafka_receivedMessageKey']

To Reproduce
We are crated a repository that reproduces the problem:

  1. Start application
  2. Go to http://localhost:8080/demo-stream-kafka/actuator/bindings

Version of the framework
SB 3.4.4
SC 2024.0.1

Observed behavior
An error is throw:

{"timestamp":"2025-03-26T11:39:23.281+00:00","status":500,"error":"Internal Server Error","message":"No serializer found for class org.springframework.expression.spel.support.StandardTypeConverter and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[10]->org.springframework.cloud.stream.binder.AbstractMessageChannelBinder$1[\"extension\"]->org.springframework.cloud.stream.binder.kafka.properties.KafkaProducerProperties[\"messageKeyExpression\"]->org.springframework.expression.spel.standard.SpelExpression[\"evaluationContext\"]->jdk.proxy2.$Proxy144[\"typeConverter\"])","errors":[]}

Expected behavior
The endpoint return the bindings information correctly.

Additional context
For SC 2024.0.0 works OK.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions