Search code examples
javatwitterapache-camelquarkus

camel-twitter component is not found in quarkus application


I'm trying to make an application in quarkus consuming from Twitter, while a test class to check for camel behaviour works fine:

package com.example.camel.route;

import org.apache.camel.builder.RouteBuilder;

public class TestRoute extends RouteBuilder{

    @Override
    public void configure() throws Exception {
        from("timer:important?period=5000&repeatCount=5").log("test");
    }

}

When I try to read from Twitter:

package com.example.camel.route;

import org.apache.camel.builder.RouteBuilder;

public class TwitterRoute extends RouteBuilder{

    @Override
    public void configure() throws Exception {
        from("twitter://streaming/filter?consumerKey=CKEY" +
        "&consumerSecret=CSECRET" +
        "&accessToken=TOKEN" +
        "&accessTokenSecret=TOKENSECRET" +
        "&keywords=%23quarkus")
        .log("test");
    }

}

It raises an exception:

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: twitter://streaming/[...removed...] due to: No component found with scheme: twitter

On my pom.xml I have added the camel-twitter dependency:

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-twitter</artifactId>
  <version>3.0.0-M2</version>
</dependency>

What else should I do so the twitter scheme is found?


Solution

  • the twitter scheme has been deprecated in camel 2.x and removed in camel 3.x so you need to use one of the new schemes, like twitter-streaming, see the camel component doc for twitter