No converter found capable of converting from type [java.lang.String] to type [org.springframework.expression.Expression]

See original GitHub issue

As far as I can track the issue down, due the commit for #2165 a regression has been created for issue #1979. I cannot start the application using a producer based expression property like ‘routingKeyExpression’ or ‘delayExpression’. If I comment them out, the application starts properly.

To Reproduce

spring:
  cloud:
    stream:
      bindings:
        inputMail:
          destination: ${rabbitmq.mail.exchange}
          group: ${rabbitmq.mail.queue}
          binder: rabbitMail
          consumer:
            maxAttempts: 1
        retryMail:
          destination: ${rabbitmq.mail.exchange}
          binder: rabbitMail
        dlqMail:
          destination: ${rabbitmq.mail.dlx}
          binder: rabbitMail
      binders:
        rabbitMail:
          type: rabbitMail
          environment:
            spring:
              cloud:
                stream:
                  rabbit:
                    bindings:
                      inputMail:
                        consumer:
                          autoBindDlq: true
                          queueNameGroupOnly: true
                          exchangeAutoDelete: false
                          deadLetterExchange: ${rabbitmq.mail.dlx}
                          delayedExchange: true
                      retryMail:
                        producer:
                          declareExchange: false
                          exchangeAutoDelete: false
                          delayExpression: 300000 # 5min
                      dlqMail:
                        producer:
                          declareExchange: false
                          exchangeAutoDelete: false
                          routingKeyExpression: '''${rabbitmq.mail.queue}'''

Version of the framework 3.1.3 (Spring cloud dependencies 2020.0.3) Spring Boot 2.4.5 and also with 2.4.7 Expected behavior Configuration works as in 3.1.2 (Spring cloud dependencies 2020.0.2)

The property will be resolved properly, but the application cannot start. Error message


Failed to bind properties under 'spring.cloud.stream.rabbit.bindings.dlqMail.producer.routing-key-expression' to org.springframework.expression.Expression:

    Property: spring.cloud.stream.rabbit.bindings.dlqMail.producer.routing-key-expression
    Value: 'mail-local'
    Origin: "spring.cloud.stream.rabbit.bindings.dlqMail.producer.routingKeyExpression" from property source "rabbitMail"
    Reason: No converter found capable of converting from type [java.lang.String] to type [org.springframework.expression.Expression]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
at-kkraycommented, Sep 3, 2021

@olegz is there any work around for this? Our application has multiple binders (kafka & rabbit) and uses @Configuration and classes for beans so cannot use version 3.1.2 due to other bug: https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1030.

1reaction
olegzcommented, Jun 28, 2021

So, it is fixed. The issue is with the fact that we’ve refactored how child (binder) context is created and not all the moving parts fell into place the right way

Read more comments on GitHub >

github_iconTop Results From Across the Web

No converter found capable of converting from type to type
I am getting the following stacktrace: org.springframework.core.convert.ConverterNotFoundException ...
Read more >
No converter found capable of converting from type ... - GitHub
No converter found capable of converting from type [java.lang.String] to type [org.springframework.expression.Expression] #2283.
Read more >
no converter found capable of converting from type string
org.springframework.core.convert.ConverterNotFoundException : No converter found capable of converting from type [org.bson.BsonUndefined] to type [java.lang.
Read more >
No converter found capable of converting from type to type
I am getting the following stacktrace: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type ...
Read more >
spring-projects/spring-data - Gitter
... the app throws a ConverterNotFoundException: No converter found capable of converting from type [byte[]] to type [org.geoserver.catalog.impl.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found