You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/04 11:26:51 UTC

[GitHub] [rocketmq-spring] fishautumn opened a new issue, #477: ListenerContainerConfiguration should not depend on concrete class StandardEnvironment

fishautumn opened a new issue, #477:
URL: https://github.com/apache/rocketmq-spring/issues/477

   Interface `ConfigurableEnvironment` should be enough for bellow code:
   
   code link: https://github.com/apache/rocketmq-spring/blob/21097621e092a618709f8220ee2ccd0acbaa3af0/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/autoconfigure/ListenerContainerConfiguration.java#L55
   
   My application has a customized `ConfigurableEnvironment` implementation, but it cannot startup correctly.
   
   Below is a demo code fragment:
   ```java
   @SpringBootApplication
   public class App {
       @Resource
       private RocketMQTemplate rocketMQTemplate;
   
       public static void main(String[] args) {
           SpringApplication app = new SpringApplication(App.class);
           app.setEnvironment(new MyEnv()); // comment out this line fixies the problem
           app.run(args);
       }
   
       static class MyEnv extends AbstractEnvironment {
       }
   }
   ```
   
   it reports bellow error on startup:
   ```
   Error creating bean with name 'org.apache.rocketmq.spring.autoconfigure.ListenerContainerConfiguration':
     Unsatisfied dependency expressed through constructor parameter 1;
   
   nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
     No qualifying bean of type 'org.springframework.core.env.StandardEnvironment' available:
     expected at least 1 bean which qualifies as autowire candidate.
     Dependency annotations: {}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] panzhi33 commented on issue #477: ListenerContainerConfiguration should not depend on concrete class StandardEnvironment

Posted by GitBox <gi...@apache.org>.
panzhi33 commented on issue #477:
URL: https://github.com/apache/rocketmq-spring/issues/477#issuecomment-1210315025

   Can inherit StandardEnvironment to customize, this can meet your business. StandardEnvironment also implements ConfigurableEnvironment


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] fishautumn commented on issue #477: ListenerContainerConfiguration should not depend on concrete class StandardEnvironment

Posted by GitBox <gi...@apache.org>.
fishautumn commented on issue #477:
URL: https://github.com/apache/rocketmq-spring/issues/477#issuecomment-1211483840

   > Can inherit StandardEnvironment to customize, this can meet your business. StandardEnvironment also implements ConfigurableEnvironment
   
   Yes, it works.
   
   However, I think rocketmq-spring only depends on interface `ConfigurableEnvironment`, so there is no reason to depend on `StandardEnvironment`, right?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] ShannonDing closed issue #477: ListenerContainerConfiguration should not depend on concrete class StandardEnvironment

Posted by GitBox <gi...@apache.org>.
ShannonDing closed issue #477: ListenerContainerConfiguration should not depend on concrete class StandardEnvironment
URL: https://github.com/apache/rocketmq-spring/issues/477


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org