CAMEL-13401: adding a webhook meta-component and first implementation with Telegram#2867
Conversation
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
Outdated
Show resolved
Hide resolved
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
Outdated
Show resolved
Hide resolved
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
Outdated
Show resolved
Hide resolved
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
Outdated
Show resolved
Hide resolved
| public class Routes extends RouteBuilder { | ||
| @Override | ||
| public void configure() { | ||
| restConfiguration().contextPath("/camel"); |
There was a problem hiding this comment.
Is the rest configuration needed, as /camel is default
There was a problem hiding this comment.
Yes, /camel is the default when using servlet in spring-boot, but the rest configuration is not aware of that. The webhook component needs to know it because it has to reconstruct the external URL of the service and I though that the contextPath of the restConfiguration was the right place.
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
Show resolved
Hide resolved
|
Thanks @davsclaus for the review, I'll apply the changes. |
|
Should be better now. |
|
@nicolaferraro you can go ahead and merge. |
|
Thanks! |
| @@ -0,0 +1,58 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |||
There was a problem hiding this comment.
Need to add the license header here.
| protected void doStop() throws Exception { | ||
| super.doStop(); | ||
|
|
||
| if (configuration.isWebhookAutoRegister()) { |
There was a problem hiding this comment.
It could be better to unregister the webhook before the WebhookEndpoint stop itself.
There was a problem hiding this comment.
Thanks, going to fix.
| @@ -0,0 +1,83 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |||
As per subject. This adds the capability for components to self register to receive push notifications instead of doing polling.
Registration is automatic by default, but it will be disabled in camel k where there will be a specific process to register webhooks.
In knative, components supporting webhooks can scale to 0 ;)
There are few things I'm not sure about... for example, the
MultiRestConsumerclass.