public Map<String, Object> getKsqlAdminClientConfigProps() { final Map<String, Object> props = new HashMap<>(); ksqlStreamConfigProps.values().stream() .filter(configValue -> AdminClientConfig.configNames().contains(configValue.key)) .forEach( configValue -> props.put(configValue.key, configValue.value)); return Collections.unmodifiableMap(props); }
/** * Get the configs for the {@link org.apache.kafka.clients.admin.AdminClient admin client}. * @param clientId clientId * @return Map of the admin client configuration. */ @SuppressWarnings("WeakerAccess") public Map<String, Object> getAdminConfigs(final String clientId) { final Map<String, Object> clientProvidedProps = getClientPropsWithPrefix(ADMIN_CLIENT_PREFIX, AdminClientConfig.configNames()); final Map<String, Object> props = new HashMap<>(); props.putAll(getClientCustomProps()); props.putAll(clientProvidedProps); // add client id with stream client id prefix props.put(CommonClientConfigs.CLIENT_ID_CONFIG, clientId + "-admin"); return props; }
/** * Get a map of custom configs by removing from the originals all the Streams, Consumer, Producer, and AdminClient configs. * Prefixed properties are also removed because they are already added by {@link #getClientPropsWithPrefix(String, Set)}. * This allows to set a custom property for a specific client alone if specified using a prefix, or for all * when no prefix is used. * * @return a map with the custom properties */ private Map<String, Object> getClientCustomProps() { final Map<String, Object> props = originals(); props.keySet().removeAll(CONFIG.names()); props.keySet().removeAll(ConsumerConfig.configNames()); props.keySet().removeAll(ProducerConfig.configNames()); props.keySet().removeAll(AdminClientConfig.configNames()); props.keySet().removeAll(originalsWithPrefix(CONSUMER_PREFIX, false).keySet()); props.keySet().removeAll(originalsWithPrefix(PRODUCER_PREFIX, false).keySet()); props.keySet().removeAll(originalsWithPrefix(ADMIN_CLIENT_PREFIX, false).keySet()); return props; }
Set<String> adminConfigNames = AdminClientConfig.configNames(); binderProperties.forEach((key, value) -> { if (key.equals(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)) {
Set<String> adminConfigNames = AdminClientConfig.configNames(); binderProperties.forEach((key, value) -> { if (key.equals(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG)) {
final AdminClientConfig adminClientDefaultConfig = new AdminClientConfig(getClientPropsWithPrefix(ADMIN_CLIENT_PREFIX, AdminClientConfig.configNames())); consumerProps.put(adminClientPrefix(AdminClientConfig.RETRIES_CONFIG), adminClientDefaultConfig.getInt(AdminClientConfig.RETRIES_CONFIG));