zhfeng commented on a change in pull request #3824:
URL: https://github.com/apache/camel/pull/3824#discussion_r424925600
##########
File path:
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
##########
@@ -78,10 +79,16 @@ public void afterPropertiesConfigured(CamelContext
camelContext) {
delegateEndpoint.setWebhookConfiguration(configuration);
}
+ @Override
+ protected void doInit() throws Exception {
+ super.doInit();
+ ServiceHelper.initService(delegateEndpoint);
Review comment:
This might be not necessary here. And it should be in
https://github.com/apache/camel/blob/master/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java#L1457
##########
File path:
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
##########
@@ -78,10 +79,16 @@ public void afterPropertiesConfigured(CamelContext
camelContext) {
delegateEndpoint.setWebhookConfiguration(configuration);
}
+ @Override
+ protected void doInit() throws Exception {
+ super.doInit();
+ ServiceHelper.initService(delegateEndpoint);
+ }
+
@Override
protected void doStart() throws Exception {
super.doStart();
-
+ ServiceHelper.startService(delegateEndpoint);
Review comment:
if the delegateEndpoint has been stared as this router is added after
the camel context started, what would happen ? The endpoint can be started
twice ?
##########
File path:
components/camel-webhook/src/main/java/org/apache/camel/component/webhook/WebhookEndpoint.java
##########
@@ -91,11 +98,17 @@ protected void doStart() throws Exception {
@Override
protected void doStop() throws Exception {
super.doStop();
-
if (configuration.isWebhookAutoRegister() && delegateEndpoint != null)
{
LOG.info("Unregistering webhook for endpoint: {}",
delegateEndpoint);
delegateEndpoint.unregisterWebhook();
}
+ ServiceHelper.stopService(delegateEndpoint);
Review comment:
Not sure it is safe to stop the endpoint here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]