You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/02/21 19:10:52 UTC

[GitHub] [camel-examples] essobedo opened a new pull request #79: Fix and simplify the example spring-pulsar

essobedo opened a new pull request #79:
URL: https://github.com/apache/camel-examples/pull/79


   ## Motivation
   
   The example spring-pulsar is broken, it fails with the next error moreover it is confusing as it refers to use cases that are yet supported and finally the tests are skipped. This example should be cleaned and simplify.
   
   ```
   2022-02-18 15:31:07,876 [ing.Main.main()] INFO  MainSupport                    - Apache Camel (Main) 3.16.0-SNAPSHOT is starting
   2022-02-18 15:31:08,928 [ing.Main.main()] INFO  bstractCamelContextFactoryBean - Adding custom TypeConverters with id: myOrderTypeConverters and implementation: org.apache.camel.example.pulsar.server.TypeConverters@4111cc1c
   2022-02-18 15:31:09,004 [ing.Main.main()] WARN  ClassPathXmlApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pulsarAdmin' defined in class path resource [META-INF/spring/camel-server.xml]: Could not resolve matching constructor on bean class [org.apache.pulsar.client.admin.PulsarAdmin] (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)
   2022-02-18 15:31:09,007 [ing.Main.main()] INFO  AbstractCamelContext           - Apache Camel 3.16.0-SNAPSHOT (camel-server) shutting down
   2022-02-18 15:31:09,010 [ing.Main.main()] INFO  AbstractCamelContext           - Routes stopped (total:0 stopped:0)
   2022-02-18 15:31:09,011 [ing.Main.main()] INFO  AbstractCamelContext           - Apache Camel 3.16.0-SNAPSHOT (camel-server) shutdown in 4ms (uptime:)
   [WARNING] 
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pulsarAdmin' defined in class path resource [META-INF/spring/camel-server.xml]: Could not resolve matching constructor on bean class [org.apache.pulsar.client.admin.PulsarAdmin] (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)
       at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (ConstructorResolver.java:280)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor (AbstractAutowireCapableBeanFactory.java:1372)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance (AbstractAutowireCapableBeanFactory.java:1222)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (AbstractAutowireCapableBeanFactory.java:582)
       at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:542)
       at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0 (AbstractBeanFactory.java:335)
       at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:234)
       at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (AbstractBeanFactory.java:333)
       at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:208)
       at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons (DefaultListableBeanFactory.java:953)
       at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java:918)
       at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:583)
       at org.springframework.context.support.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:144)
       at org.springframework.context.support.ClassPathXmlApplicationContext.<init> (ClassPathXmlApplicationContext.java:95)
       at org.apache.camel.spring.Main.createDefaultApplicationContext (Main.java:289)
       at org.apache.camel.spring.Main.doStart (Main.java:195)
       at org.apache.camel.support.service.BaseService.start (BaseService.java:119)
       at org.apache.camel.main.MainSupport.run (MainSupport.java:81)
       at org.apache.camel.main.MainCommandLineSupport.run (MainCommandLineSupport.java:177)
       at org.apache.camel.spring.Main.main (Main.java:97)
       at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
       at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
       at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke (Method.java:566)
       at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
       at java.lang.Thread.run (Thread.java:829)
   ```
   ## Modifications
   
   * Remove the use cases (`CamelClientRemoting` and `CamelClientEndpoint`) that are not yet working according to the read me
   * Enable the tests
   * Modify the docker run command to use the target directory to store the data and to remove the container automatically on stop
   * Review the readme to describe only one use-case
   * Use `try-with-resource` statement to automatically close the Spring context
   * Improve a little bit the client to produce 10 random integers to multiply
   * Add the class `Beans` which holds beans that are complicated to create using pure XML like `PulsarAdmin` as it needs a builder
   * Propose a type converter managing both sides (int <-> byte array)
   * Refactor the XML configuration files in such a way that everything in common between the server and the client are moved to a new file called `camel-common.xml`
   * Remove `camel.properties` as it is not used
   * Rewrite and simplify the test case to just ensure that a message can be sent to and consume from Pulsar thanks to Camel


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] davsclaus commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047213706


   +1 me too


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] davsclaus merged pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #79:
URL: https://github.com/apache/camel-examples/pull/79


   


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] orpiske edited a comment on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
orpiske edited a comment on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047188083


   +1, I think we should use `camel-test-infra-pulsar`. 


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] essobedo commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
essobedo commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047199928


   @davsclaus @orpiske I understand your point of view however as the other tests use also testcontainers directly, for the sake of consistency, I think it would be better to migrate everything within the context of another PR to avoid mixing subjects. I can do it tomorrow if you want.


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] orpiske commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047188083


   +1, I think we should be use `camel-test-infra-pulsar`. 


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] orpiske commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047200719


   > @davsclaus @orpiske I understand your point of view however as the other tests use also testcontainers directly, for the sake of consistency, I think it would be better to migrate everything within the context of another PR to avoid mixing subjects. I can do it tomorrow if you want.
   
   +1 from me.


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] davsclaus commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047179695


   I wonder if you can use https://github.com/apache/camel/tree/main/test-infra/camel-test-infra-pulsar instead of test-containers?
   
   @orpiske knows more about camel-test-infra
   
   There is also this blog post
   https://camel.apache.org/blog/2022/02/camel-test-infra/


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] essobedo commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
essobedo commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047721831


   @davsclaus @orpiske as promised https://github.com/apache/camel-examples/pull/80
   
   @orpiske Nice work! camel-test-infra definitively helps to reduce the complexity of the tests 


-- 
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: commits-unsubscribe@camel.apache.org

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



[GitHub] [camel-examples] orpiske commented on pull request #79: Fix and simplify the example spring-pulsar

Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #79:
URL: https://github.com/apache/camel-examples/pull/79#issuecomment-1047724098


   Thanks and thanks for doing the improvement!


-- 
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: commits-unsubscribe@camel.apache.org

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