Interface WebhookCapableEndpoint
- All Superinterfaces:
AutoCloseable,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service
public interface WebhookCapableEndpoint
extends org.apache.camel.Endpoint
A
WebhookCapableEndpoint is a special kind of endpoint that is able to operate in webhook mode if required.
The interface defines methods for registering/unregistering webhooks as well as callback methods for the webhook workflow.
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ProcessorcreateWebhookHandler(org.apache.camel.Processor next) Creates a processor for the webhook that is responsible for receiving all messages sent to the webhook.Used by the endpoint to enlist the HTTP methods it's able to handle.voidRegister the webhook at the remote site using endpoint specific instruction.voidsetWebhookConfiguration(WebhookConfiguration webhookConfiguration) Used by the workflow manager to inject webhook configuration options.voidUnregister the webhook at the remote site using endpoint specific instruction.Methods inherited from interface org.apache.camel.Endpoint
configureExchange, configureProperties, createAsyncProducer, createConsumer, createExchange, createExchange, createPollingConsumer, createProducer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isSingletonProducer, setCamelContextMethods inherited from interface org.apache.camel.IsSingleton
isSingletonMethods inherited from interface org.apache.camel.Service
build, close, init, start, stop
-
Method Details
-
createWebhookHandler
org.apache.camel.Processor createWebhookHandler(org.apache.camel.Processor next) Creates a processor for the webhook that is responsible for receiving all messages sent to the webhook.The processor should distinguish handshakes from standard calls and forward relevant data to the downstream processor after transformation. Data forwarded to the downstream processor should be of the same type as data generated by the corresponding polling consumer.
- Parameters:
next- the downstream processor.- Returns:
- the webhook route processor
-
registerWebhook
Register the webhook at the remote site using endpoint specific instruction.Additional configuration is injected into the endpoint using the setWebhookConfiguration method.
- Throws:
Exception- if something goes wrong during the registration.
-
unregisterWebhook
Unregister the webhook at the remote site using endpoint specific instruction.Additional configuration is injected into the endpoint using the setWebhookConfiguration method.
- Throws:
Exception- if something goes wrong during the un-registration.
-
setWebhookConfiguration
Used by the workflow manager to inject webhook configuration options.- Parameters:
webhookConfiguration- the webhook configuration options.
-
getWebhookMethods
Used by the endpoint to enlist the HTTP methods it's able to handle. Usually only "POST" is used, but some webhook providers require multiple verbs in the handshake phase.- Returns:
- the HTTP methods supported by the endpoint
-