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
CAMEL-9969: Added a component for Telegram #988
Conversation
LGTM :-) @davsclaus waiting for your feedback too :-) |
* The Camel endpoint for a telegram bot. | ||
*/ | ||
@UriEndpoint(scheme = "telegram", title = "Telegram", syntax = "telegram:type/authorizationToken", consumerClass = TelegramConsumer.class, label = "chat") | ||
public class TelegramEndpoint extends DefaultEndpoint { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The consumer extends ScheduledPollConsumer and therefore you likely want the endpoint to extend ScheduledPollEndpoint that gives you a lot of scheduling outputs for the consumer.
Yeah looks very good. I posted some comments on the code. |
In the meantime, I fixed the other issues. |
Thank look good. @oscerd I think you can merge this to the master branch. |
@nicolaferraro @davsclaus Merged! Thanks! :-) |
Can you close this PR? Thanks for contribution :-) |
Closed. Thank you guys :D |
Entesb 11331 sb2
I created a new component for Telegram.
The component uses the Telegram Bot REST API (https://core.telegram.org/bots/api).
There are multiple Java wrappers for the REST API available as open source projects, but
many of them are not "mature" to be included in the camel component.
An alternative option could have been https://github.com/rubenlagus/TelegramBots, but it is
released under GPLv3 license.
Since the Bot API are simple and well documented, I decided to include a Java REST interface directly inside the component.
The Java API that wraps the REST services contains many features (Text messages, audio, video and photo), but it is not 100% complete.
I don't know if it's worth completing it, or maybe leave some issues on Jira to complete it later.
The API is self-consistent at this time, even if it is not complete.
The Telegram services do not allow two bots to exchange messages, so integration tests would be impossible without a human intervention.
So I divided the tests in two stages:
Integration tests are disabled in surefire CI (unless you provide some environment variables).
I added a .adoc file for documenting the endpoint (consumer and producer).
I haven't put the documentation on the Wiki pages because...
I think I had better wait for a review :)