Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram test doesn't work #1550

Closed
llowinge opened this issue Aug 20, 2020 · 2 comments · Fixed by #1554
Closed

Telegram test doesn't work #1550

llowinge opened this issue Aug 20, 2020 · 2 comments · Fixed by #1554
Milestone

Comments

@llowinge
Copy link
Contributor

Taking master branch,

Setting
export TELEGRAM_AUTHORIZATION_TOKEN=ABCD

and running

mvn clean integration-test -pl :camel-quarkus-integration-test-telegram

I'm getting:

[INFO] Running org.apache.camel.quarkus.component.telegram.it.TelegramTest
2020-08-20 15:06:47,985 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) bootstrap runtime: org.apache.camel.quarkus.core.CamelContextRuntime
2020-08-20 15:06:48,024 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.4.3 (camel-1) is starting
2020-08-20 15:06:48,026 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2020-08-20 15:06:48,028 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Total 0 routes, of which 0 are started
2020-08-20 15:06:48,028 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.4.3 (camel-1) started in 0.003 seconds
2020-08-20 15:06:48,140 INFO  [io.quarkus] (main) Quarkus 1.7.0.Final on JVM started in 2.357s. Listening on: http://0.0.0.0:55785
2020-08-20 15:06:48,140 INFO  [io.quarkus] (main) Profile test activated.
2020-08-20 15:06:48,140 INFO  [io.quarkus] (main) Installed features: [camel-attachments, camel-core, camel-platform-http, camel-policy, camel-support-ahc, camel-support-common, camel-support-webhook, camel-telegram, cdi, mutiny, resteasy, resteasy-jackson, smallrye-context-propagation, vertx, vertx-web]
2020-08-20 15:06:49,436 TRACE [org.apa.cam.sup.DefaultComponent] (executor-thread-1) Creating endpoint uri=[telegram://bots], path=[bots], parameters=[{}]
2020-08-20 15:06:49,447 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /telegram/messages failed, error id: 9893835d-8bcb-436f-8b24-19af6bd12d4a-1: org.jboss.resteasy.spi.UnhandledException: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: telegram://bots due to: AuthorizationToken must be configured on either component or endpoint for telegram: telegram://bots
	at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:216)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:515)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:259)
	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:160)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:163)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:245)
	at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:132)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.access$000(VertxRequestHandler.java:37)
	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:94)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at java.base/java.lang.Thread.run(Thread.java:834)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: telegram://bots due to: AuthorizationToken must be configured on either component or endpoint for telegram: telegram://bots
	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:878)
	at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:768)
	at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
	at org.apache.camel.impl.engine.DefaultConsumerTemplate.resolveMandatoryEndpoint(DefaultConsumerTemplate.java:235)
	at org.apache.camel.impl.engine.DefaultConsumerTemplate.receiveNoWait(DefaultConsumerTemplate.java:106)
	at org.apache.camel.impl.engine.DefaultConsumerTemplate.receiveBodyNoWait(DefaultConsumerTemplate.java:198)
	at org.apache.camel.quarkus.component.telegram.it.TelegramResource.getMessages(TelegramResource.java:62)
	at org.apache.camel.quarkus.component.telegram.it.TelegramResource_ClientProxy.getMessages(TelegramResource_ClientProxy.zig:362)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
	at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:638)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:504)
	at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:454)
	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:456)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:417)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:391)
	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:68)
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488)
	... 17 more
Caused by: java.lang.IllegalArgumentException: AuthorizationToken must be configured on either component or endpoint for telegram: telegram://bots
	at org.apache.camel.component.telegram.TelegramComponent.createEndpoint(TelegramComponent.java:68)
	at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:237)
	at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:846)
	... 39 more

Maybe it is connected to apache/camel-k#1039 (comment).

Also i'm not sure, i totally understand the message AuthorizationToken must be configured on either component or endpoint for telegram: telegram://bots because it fails when only checking the existence of authorizationToken in endpoint (https://github.com/apache/camel/blob/master/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramComponent.java#L68).

I would say this https://github.com/apache/camel-quarkus/blob/master/integration-tests/telegram/src/main/resources/application.properties#L30 is not used at all.

@jamesnetherton
Copy link
Contributor

I would say this https://github.com/apache/camel-quarkus/blob/master/integration-tests/telegram/src/main/resources/application.properties#L30 is not used at all.

The test needs camel-quarkus-main for that to work. Can you try adding it?

@llowinge
Copy link
Contributor Author

@jamesnetherton I've just randomly found your commit 151feb0 one minute ago :D I've tried already and looks like it fixed that problem, but tests are failing, but i will investigate more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants