Class DynamicRouterControlService

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.dynamicrouter.control.DynamicRouterControlService
All Implemented Interfaces:
AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@Converter(generateBulkLoader=true) @ManagedResource(description="Dynamic Router control operations service") public class DynamicRouterControlService extends org.apache.camel.support.service.ServiceSupport
A service for managing dynamic routing subscriptions.
  • Constructor Details

    • DynamicRouterControlService

      public DynamicRouterControlService(org.apache.camel.CamelContext camelContext, DynamicRouterFilterService filterService)
      Parameters:
      camelContext - the camel context
      filterService - the filter service
  • Method Details

    • subscribeWithPredicateExpression

      @ManagedOperation(description="Subscribe for dynamic routing with a predicate expression") public String subscribeWithPredicateExpression(String subscribeChannel, String subscriptionId, String destinationUri, int priority, String predicate, String expressionLanguage, boolean update)
      Subscribes for dynamic routing with a predicate expression.
      Parameters:
      subscribeChannel - the subscribe channel
      subscriptionId - the subscription ID
      destinationUri - the destination URI
      priority - the priority
      predicate - the predicate
      expressionLanguage - the expression language
      update - whether to update the subscription if it already exists, or add a new one
      Returns:
      the subscription ID for the added/updated subscription
    • subscribeWithPredicateBean

      @ManagedOperation(description="Subscribe for dynamic routing with the name of a predicate bean in the registry") public String subscribeWithPredicateBean(String subscribeChannel, String subscriptionId, String destinationUri, int priority, String predicateBean, boolean update)
      Subscribes for dynamic routing with the name of a predicate bean in the registry.
      Parameters:
      subscribeChannel - the subscribe channel
      subscriptionId - the subscription ID
      destinationUri - the destination URI
      priority - the priority
      predicateBean - the predicate bean name
      update - whether to update the subscription if it already exists, or add a new one
      Returns:
      the subscription ID for the added/updated subscription
    • subscribeWithPredicateInstance

      @ManagedOperation(description="Subscribe for dynamic routing with a predicate instance") public String subscribeWithPredicateInstance(String subscribeChannel, String subscriptionId, String destinationUri, int priority, Object predicate, boolean update)
      Subscribes for dynamic routing with a predicate instance.
      Parameters:
      subscribeChannel - the subscribe channel
      subscriptionId - the subscription ID
      destinationUri - the destination URI
      priority - the priority
      predicate - the predicate instance
      update - whether to update the subscription if it already exists, or add a new one
      Returns:
      the subscription ID for the added/updated subscription
    • removeSubscription

      @ManagedOperation(description="Unsubscribe for dynamic routing on a channel by subscription ID") public boolean removeSubscription(String subscribeChannel, String subscriptionId)
      Subscribes for dynamic routing with a predicate expression.
      Parameters:
      subscribeChannel - the subscribe channel
      subscriptionId - the subscription ID
      Returns:
      true if the subscription was removed, false otherwise
    • getSubscriptionsMap

      @ManagedAttribute(description="Get the map of filters for all dynamic router channels") public Map<String,ConcurrentSkipListSet<PrioritizedFilter>> getSubscriptionsMap()
      Retrieves a copy of the filter map.
      Returns:
      a copy of the filter map
    • getSubscriptionsStatisticsMap

      @ManagedAttribute(description="Get the map of statistics for all dynamic router channels") public Map<String,List<PrioritizedFilterStatistics>> getSubscriptionsStatisticsMap()
      Retrieves a copy of the filter statistics map.
      Returns:
      a copy of the filter statistics map
    • getSubscriptionsForChannel

      public String getSubscriptionsForChannel(String subscribeChannel)
      Retrieves a copy of the filter map for the provided channel.
      Parameters:
      subscribeChannel - the subscribe channel
      Returns:
      a copy of the filter map for the provided channel
    • getStatisticsForChannel

      public String getStatisticsForChannel(String subscribeChannel)
      Retrieves a copy of the filter statistics map for the provided channel.
      Parameters:
      subscribeChannel - the subscribe channel
      Returns:
      a copy of the filter statistics map for the provided channel