Class PulsarConnectorCommonConfiguration

java.lang.Object
io.smallrye.reactive.messaging.pulsar.PulsarConnectorCommonConfiguration
Direct Known Subclasses:
PulsarConnectorIncomingConfiguration, PulsarConnectorOutgoingConfiguration

public class PulsarConnectorCommonConfiguration extends Object
Extracts the common configuration for the smallrye-pulsar connector.
  • Field Details

    • config

      protected final org.eclipse.microprofile.config.Config config
  • Constructor Details

    • PulsarConnectorCommonConfiguration

      public PulsarConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config)
      Creates a new PulsarConnectorCommonConfiguration.
  • Method Details

    • config

      public org.eclipse.microprofile.config.Config config()
      Returns:
      the connector configuration
    • getFromAlias

      protected <T> Optional<T> getFromAlias(String alias, Class<T> type)
      Retrieves the value stored for the given alias.
      Type Parameters:
      T - the targeted type
      Parameters:
      alias - the attribute alias, must not be null or blank
      type - the targeted type
      Returns:
      the configuration value for the given alias, empty if not set
    • getFromAliasWithDefaultValue

      protected <T> T getFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue)
      Retrieves the value stored for the given alias. Returns the default value if not present.
      Type Parameters:
      T - the targeted type
      Parameters:
      alias - the attribute alias, must not be null or blank
      type - the targeted type
      defaultValue - the default value
      Returns:
      the configuration value for the given alias, empty if not set
    • getChannel

      public String getChannel()
      Returns:
      the channel name
    • getClientConfiguration

      public Optional<String> getClientConfiguration()
      Gets the client-configuration value from the configuration. Attribute Name: client-configuration Description: Identifier of a CDI bean that provides the default Pulsar client configuration for this channel. The channel configuration can still override any attribute. The bean must have a type of Map<String, Object> and must use the @io.smallrye.common.annotation.Identifier qualifier to set the identifier.
      Returns:
      the client-configuration
    • getServiceUrl

      public String getServiceUrl()
      Gets the serviceUrl value from the configuration. Attribute Name: serviceUrl Description: The service URL for the Pulsar service Default Value: pulsar://localhost:6650
      Returns:
      the serviceUrl
    • getTopic

      public Optional<String> getTopic()
      Gets the topic value from the configuration. Attribute Name: topic Description: The consumed / populated Pulsar topic. If not set, the channel name is used
      Returns:
      the topic
    • getSchema

      public Optional<String> getSchema()
      Gets the schema value from the configuration. Attribute Name: schema Description: The Pulsar schema type of this channel. When configured a schema is built with the given SchemaType and used for the channel. When absent, the schema is resolved searching for a CDI bean typed `Schema` qualified with `@Identifier` and the channel name. As a fallback AUTO_CONSUME or AUTO_PRODUCE are used.
      Returns:
      the schema
    • getHealthEnabled

      public Boolean getHealthEnabled()
      Gets the health-enabled value from the configuration. Attribute Name: health-enabled Description: Whether health reporting is enabled (default) or disabled Default Value: true
      Returns:
      the health-enabled
    • getTracingEnabled

      public Boolean getTracingEnabled()
      Gets the tracing-enabled value from the configuration. Attribute Name: tracing-enabled Description: Whether tracing is enabled (default) or disabled Default Value: true
      Returns:
      the tracing-enabled
    • validate

      public void validate()