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 Type
    Method
    Description
    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.
    Used by the endpoint to enlist the HTTP methods it's able to handle.
    void
    Register the webhook at the remote site using endpoint specific instruction.
    void
    Used by the workflow manager to inject webhook configuration options.
    void
    Unregister 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, setCamelContext

    Methods inherited from interface org.apache.camel.IsSingleton

    isSingleton

    Methods 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

      void registerWebhook() throws Exception
      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

      void unregisterWebhook() throws Exception
      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

      void setWebhookConfiguration(WebhookConfiguration webhookConfiguration)
      Used by the workflow manager to inject webhook configuration options.
      Parameters:
      webhookConfiguration - the webhook configuration options.
    • getWebhookMethods

      List<String> 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