Class DefaultServiceBusNamespaceProcessorFactory

java.lang.Object
com.azure.spring.messaging.servicebus.core.DefaultServiceBusNamespaceProcessorFactory
All Implemented Interfaces:
ServiceBusProcessorFactory, org.springframework.beans.factory.DisposableBean

public final class DefaultServiceBusNamespaceProcessorFactory extends Object implements ServiceBusProcessorFactory, org.springframework.beans.factory.DisposableBean
The ServiceBusProcessorFactory implementation to produce new ServiceBusProcessorClient instances for provided NamespaceProperties and optional processor PropertiesSupplier on each createProcessor(java.lang.String, com.azure.spring.cloud.service.listener.MessageListener<?>, com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler) invocation.

ServiceBusProcessorClient produced by this factory will share the same namespace level configuration, but if a configuration entry is provided at both processor and namespace level, the processor level configuration will take advantage.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.azure.spring.messaging.servicebus.core.ServiceBusProcessorFactory

    ServiceBusProcessorFactory.Listener
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a factory with the provided namespace level properties.
    Construct a factory with the provided namespace level properties and processor PropertiesSupplier.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBuilderCustomizer(com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusProcessorClientBuilder> customizer)
    Add a ServiceBusClientBuilder.ServiceBusProcessorClientBuilder customizer to customize all the non-session clients created from this factory.
    void
    addBuilderCustomizer(String entityName, String subscription, com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusProcessorClientBuilder> customizer)
    Add a service client builder customizer to customize the clients created from this factory with entity name of value entityName and subscription of value subscription.
    void
    Add a listener for this factory.
    void
    addSessionBuilderCustomizer(com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder> customizer)
    Add a ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder customizer to customize all the session clients created from this factory.
    void
    addSessionBuilderCustomizer(String entityName, String subscription, com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder> customizer)
    Add a service client builder customizer to customize the clients created from this factory with entity name of value entityName and subscription of value subscription.
    com.azure.messaging.servicebus.ServiceBusProcessorClient
    createProcessor(String queue, com.azure.spring.cloud.service.listener.MessageListener<?> messageListener, com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler)
    Create a ServiceBusProcessorClient to consume events from the specified queue.
    com.azure.messaging.servicebus.ServiceBusProcessorClient
    Create a ServiceBusProcessorClient to consume events from the specified queue.
    com.azure.messaging.servicebus.ServiceBusProcessorClient
    createProcessor(String topic, String subscription, com.azure.spring.cloud.service.listener.MessageListener<?> messageListener, com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler)
    Create a ServiceBusProcessorClient to consume events from the specified topic in the context of the given subscription.
    com.azure.messaging.servicebus.ServiceBusProcessorClient
    createProcessor(String topic, String subscription, ServiceBusContainerProperties containerProperties)
    Create a ServiceBusProcessorClient to consume events from the specified topic in the context of the given subscription.
    void
     
    void
    setDefaultCredential(com.azure.core.credential.TokenCredential defaultCredential)
    Set the default credential for all clients generated from this factory.
    void
    setTokenCredentialResolver(com.azure.spring.cloud.core.credential.AzureCredentialResolver<com.azure.core.credential.TokenCredential> tokenCredentialResolver)
    Set the token credential resolver.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.spring.messaging.servicebus.core.ServiceBusProcessorFactory

    removeListener
  • Constructor Details

  • Method Details

    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
    • createProcessor

      public com.azure.messaging.servicebus.ServiceBusProcessorClient createProcessor(String queue, com.azure.spring.cloud.service.listener.MessageListener<?> messageListener, com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler)
      Description copied from interface: ServiceBusProcessorFactory
      Create a ServiceBusProcessorClient to consume events from the specified queue.
      Specified by:
      createProcessor in interface ServiceBusProcessorFactory
      Parameters:
      queue - The queue name.
      messageListener - message listener to be registered on service bus processor client.
      errorHandler - the error handler to consume the errors.
      Returns:
      ServiceBusProcessorClient queue processor client.
    • createProcessor

      public com.azure.messaging.servicebus.ServiceBusProcessorClient createProcessor(String queue, ServiceBusContainerProperties containerProperties)
      Description copied from interface: ServiceBusProcessorFactory
      Create a ServiceBusProcessorClient to consume events from the specified queue.
      Specified by:
      createProcessor in interface ServiceBusProcessorFactory
      Parameters:
      queue - The queue name.
      containerProperties - the ServiceBusContainerProperties to describe the processor.
      Returns:
      the queue processor client.
    • createProcessor

      public com.azure.messaging.servicebus.ServiceBusProcessorClient createProcessor(String topic, String subscription, com.azure.spring.cloud.service.listener.MessageListener<?> messageListener, com.azure.spring.cloud.service.servicebus.consumer.ServiceBusErrorHandler errorHandler)
      Description copied from interface: ServiceBusProcessorFactory
      Create a ServiceBusProcessorClient to consume events from the specified topic in the context of the given subscription.
      Specified by:
      createProcessor in interface ServiceBusProcessorFactory
      Parameters:
      topic - The topic.
      subscription - The subscription.
      messageListener - message listener to be registered on service bus processor client.
      errorHandler - the error handler to consume the errors.
      Returns:
      the topic processor client.
    • createProcessor

      public com.azure.messaging.servicebus.ServiceBusProcessorClient createProcessor(String topic, String subscription, ServiceBusContainerProperties containerProperties)
      Description copied from interface: ServiceBusProcessorFactory
      Create a ServiceBusProcessorClient to consume events from the specified topic in the context of the given subscription.
      Specified by:
      createProcessor in interface ServiceBusProcessorFactory
      Parameters:
      topic - The topic.
      subscription - The subscription.
      containerProperties - the ServiceBusContainerProperties to describe the processor.
      Returns:
      the topic processor client.
    • addListener

      public void addListener(ServiceBusProcessorFactory.Listener listener)
      Description copied from interface: ServiceBusProcessorFactory
      Add a listener for this factory.
      Specified by:
      addListener in interface ServiceBusProcessorFactory
      Parameters:
      listener - the listener.
    • setTokenCredentialResolver

      public void setTokenCredentialResolver(com.azure.spring.cloud.core.credential.AzureCredentialResolver<com.azure.core.credential.TokenCredential> tokenCredentialResolver)
      Set the token credential resolver.
      Parameters:
      tokenCredentialResolver - The token credential resolver.
    • setDefaultCredential

      public void setDefaultCredential(com.azure.core.credential.TokenCredential defaultCredential)
      Set the default credential for all clients generated from this factory.
      Parameters:
      defaultCredential - The default credential.
    • addBuilderCustomizer

      public void addBuilderCustomizer(com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusProcessorClientBuilder> customizer)
      Add a ServiceBusClientBuilder.ServiceBusProcessorClientBuilder customizer to customize all the non-session clients created from this factory.
      Parameters:
      customizer - the provided builder customizer.
    • addSessionBuilderCustomizer

      public void addSessionBuilderCustomizer(com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder> customizer)
      Add a ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder customizer to customize all the session clients created from this factory.
      Parameters:
      customizer - the provided builder customizer.
    • addBuilderCustomizer

      public void addBuilderCustomizer(String entityName, String subscription, com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusProcessorClientBuilder> customizer)
      Add a service client builder customizer to customize the clients created from this factory with entity name of value entityName and subscription of value subscription.
      Parameters:
      entityName - the entity name, could either be the queue name or topic name.
      subscription - the subscription name of the topic, could be null if it is a queue.
      customizer - the provided customizer.
    • addSessionBuilderCustomizer

      public void addSessionBuilderCustomizer(String entityName, String subscription, com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer<com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder> customizer)
      Add a service client builder customizer to customize the clients created from this factory with entity name of value entityName and subscription of value subscription.
      Parameters:
      entityName - the entity name, could either be the queue name or topic name.
      subscription - the subscription name of the topic, could be null if it is a queue.
      customizer - the provided customizer.