Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions kafka-connect-base/include/etc/confluent/docker/configure
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,19 @@ then
dub ensure CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL
fi

dub path /etc/"${COMPONENT}"/ writable
# Set default value for CONNECT_PROPERTIES_DIR if not provided
export CONNECT_PROPERTIES_DIR=${CONNECT_PROPERTIES_DIR:-/etc/${COMPONENT}/}

dub template "/etc/confluent/docker/${COMPONENT}.properties.template" "/etc/${COMPONENT}/${COMPONENT}.properties"
# Ensure the properties directory exists and is writable
dub path "${CONNECT_PROPERTIES_DIR}" writable

# The connect-distributed script expects the log4j config at /etc/kafka/connect-log4j.properties.
dub template "/etc/confluent/docker/log4j.properties.template" "/etc/kafka/connect-log4j.properties"
dub template "/etc/confluent/docker/${COMPONENT}.properties.template" "${CONNECT_PROPERTIES_DIR}/${COMPONENT}.properties"

# Set KAFKA_LOG4J_OPTS if CONNECT_PROPERTIES_DIR is set
if [ -n "$CONNECT_PROPERTIES_DIR" ]; then
export KAFKA_LOG4J_OPTS="-Dlog4j2.configurationFile=${CONNECT_PROPERTIES_DIR}/connect-log4j.properties"
dub template "/etc/confluent/docker/log4j.properties.template" "${CONNECT_PROPERTIES_DIR}/connect-log4j.properties"
else
# The connect-distributed script expects the log4j config at /etc/kafka/connect-log4j.properties.
dub template "/etc/confluent/docker/log4j.properties.template" "/etc/kafka/connect-log4j.properties"
fi
5 changes: 4 additions & 1 deletion kafka-connect-base/include/etc/confluent/docker/launch
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Set default value for CONNECT_PROPERTIES_DIR if not provided
export CONNECT_PROPERTIES_DIR=${CONNECT_PROPERTIES_DIR:-/etc/${COMPONENT}/}


# Override this section from the script to include the com.sun.management.jmxremote.rmi.port property.
if [ -z "$KAFKA_JMX_OPTS" ]; then
Expand Down Expand Up @@ -41,4 +44,4 @@ echo "===> Launching ${COMPONENT} ... "
if [ -z "$CLASSPATH" ]; then
export CLASSPATH="/etc/kafka-connect/jars/*"
fi
exec connect-distributed /etc/"${COMPONENT}"/"${COMPONENT}".properties
exec connect-distributed "${CONNECT_PROPERTIES_DIR}/${COMPONENT}.properties"