Class PulsarConnectorCommonConfiguration
java.lang.Object
io.smallrye.reactive.messaging.pulsar.PulsarConnectorCommonConfiguration
- Direct Known Subclasses:
PulsarConnectorIncomingConfiguration,PulsarConnectorOutgoingConfiguration
Extracts the common configuration for the
smallrye-pulsar connector.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPulsarConnectorCommonConfiguration(org.eclipse.microprofile.config.Config config) Creates a new PulsarConnectorCommonConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.microprofile.config.Configconfig()Gets the client-configuration value from the configuration.protected <T> Optional<T>getFromAlias(String alias, Class<T> type) Retrieves the value stored for the given alias.protected <T> TgetFromAliasWithDefaultValue(String alias, Class<T> type, T defaultValue) Retrieves the value stored for the given alias.Gets the health-enabled value from the configuration.Gets the schema value from the configuration.Gets the serviceUrl value from the configuration.getTopic()Gets the topic value from the configuration.Gets the tracing-enabled value from the configuration.voidvalidate()
-
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
Retrieves the value stored for the given alias.- Type Parameters:
T- the targeted type- Parameters:
alias- the attribute alias, must not benullor blanktype- the targeted type- Returns:
- the configuration value for the given alias, empty if not set
-
getFromAliasWithDefaultValue
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 benullor blanktype- the targeted typedefaultValue- the default value- Returns:
- the configuration value for the given alias, empty if not set
-
getChannel
- Returns:
- the channel name
-
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
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
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
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
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
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()
-