-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from RADAR-base/master
Merge dev into master
- Loading branch information
Showing
38 changed files
with
1,064 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,81 @@ | ||
#!/bin/bash | ||
|
||
# Check if variables exist | ||
if [ -z "$CONNECT_ZOOKEEPER_CONNECT" ]; then | ||
echo "CONNECT_ZOOKEEPER_CONNECT is not defined" | ||
exit 2 | ||
max_timeout=32 | ||
|
||
IS_TEMP=0 | ||
|
||
if [ -z "$COMMAND_CONFIG_FILE_PATH" ]; then | ||
COMMAND_CONFIG_FILE_PATH="$(mktemp)" | ||
IS_TEMP=1 | ||
fi | ||
|
||
if [ -z "$CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL" ]; then | ||
echo "CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL is not defined" | ||
exit 4 | ||
if [ ! -f "$COMMAND_CONFIG_FILE_PATH" ] || [ $IS_TEMP = 1 ]; then | ||
while IFS='=' read -r -d '' n v; do | ||
if [[ "$n" == "CONNECT_"* ]]; then | ||
name="${n/CONNECT_/""}" # remove first "CONNECT_" | ||
name="${name,,}" # lower case | ||
name="${name//_/"."}" # replace all '_' with '.' | ||
echo "$name=$v" >> ${COMMAND_CONFIG_FILE_PATH} | ||
fi | ||
done < <(env -0) | ||
fi | ||
|
||
KAFKA_BROKERS=${KAFKA_BROKERS:-3} | ||
# Check if variables exist | ||
if [ -z "$CONNECT_BOOTSTRAP_SERVERS" ]; then | ||
echo "CONNECT_BOOTSTRAP_SERVERS is not defined" | ||
else | ||
KAFKA_BROKERS=${KAFKA_BROKERS:-3} | ||
|
||
max_timeout=32 | ||
tries=10 | ||
timeout=1 | ||
while true; do | ||
KAFKA_CHECK=$(kafka-broker-api-versions --bootstrap-server "$CONNECT_BOOTSTRAP_SERVERS" --command-config "${COMMAND_CONFIG_FILE_PATH}" | grep "(id: " | wc -l) | ||
|
||
tries=10 | ||
timeout=1 | ||
while true; do | ||
ZOOKEEPER_CHECK=$(zookeeper-shell ${CONNECT_ZOOKEEPER_CONNECT} <<< "ls /brokers/ids" | tail -1) | ||
echo "Zookeeper response: ${ZOOKEEPER_CHECK}" | ||
# ZOOKEEPER_CHECK="${ZOOKEEPER_CHECK##*$'\n'}" | ||
ZOOKEEPER_CHECK="$(echo -e "${ZOOKEEPER_CHECK}" | tr -d '[:space:]' | tr -d '[' | tr -d ']')" | ||
if [ "$KAFKA_CHECK" -ge "$KAFKA_BROKERS" ]; then | ||
echo "Kafka brokers available." | ||
break | ||
fi | ||
|
||
IFS=',' read -r -a array <<< ${ZOOKEEPER_CHECK} | ||
LENGTH=${#array[@]} | ||
if [ "$LENGTH" -eq "$KAFKA_BROKERS" ]; then | ||
echo "Kafka brokers available." | ||
break | ||
fi | ||
tries=$((tries - 1)) | ||
if [ ${tries} -eq 0 ]; then | ||
echo "FAILED: KAFKA BROKERs NOT READY." | ||
exit 5 | ||
fi | ||
echo "Expected $KAFKA_BROKERS brokers but found only $KAFKA_CHECK. Waiting $timeout second before retrying ..." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
|
||
tries=$((tries - 1)) | ||
if [ ${tries} -eq 0 ]; then | ||
echo "FAILED: KAFKA BROKERs NOT READY." | ||
exit 5 | ||
fi | ||
echo "Expected $KAFKA_BROKERS brokers but found only $LENGTH. Waiting $timeout second before retrying ..." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
echo "Kafka is available." | ||
fi | ||
|
||
tries=10 | ||
timeout=1 | ||
while true; do | ||
if wget --spider -q "${CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL}/subjects" 2>/dev/null; then | ||
echo "Schema registry available." | ||
break | ||
fi | ||
tries=$((tries - 1)) | ||
if [ $tries -eq 0 ]; then | ||
echo "FAILED TO REACH SCHEMA REGISTRY." | ||
exit 6 | ||
fi | ||
echo "Failed to reach schema registry. Retrying in ${timeout} seconds." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
if [ -z "$CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL" ]; then | ||
echo "CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL is not defined" | ||
else | ||
tries=10 | ||
timeout=1 | ||
while true; do | ||
if wget --spider -q "${CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL}/subjects" 2>/dev/null; then | ||
echo "Schema registry available." | ||
break | ||
fi | ||
tries=$((tries - 1)) | ||
if [ $tries -eq 0 ]; then | ||
echo "FAILED TO REACH SCHEMA REGISTRY." | ||
exit 6 | ||
fi | ||
echo "Failed to reach schema registry. Retrying in ${timeout} seconds." | ||
sleep ${timeout} | ||
if [ ${timeout} -lt ${max_timeout} ]; then | ||
timeout=$((timeout * 2)) | ||
fi | ||
done | ||
|
||
echo "Schema registry is available." | ||
fi | ||
|
||
echo "Kafka is available. Ready to go!" | ||
if [ $IS_TEMP = 1 ]; then | ||
/bin/rm -f "$COMMAND_CONFIG_FILE_PATH" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
~ specific language governing permissions and limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
|
@@ -25,7 +26,7 @@ | |
<groupId>io.confluent</groupId> | ||
<artifactId>kafka-connect-jdbc</artifactId> | ||
<packaging>jar</packaging> | ||
<version>10.3.1</version> | ||
<version>10.5.2</version> | ||
<name>kafka-connect-jdbc</name> | ||
<organization> | ||
<name>Confluent, Inc.</name> | ||
|
@@ -48,18 +49,20 @@ | |
<connection>scm:git:git://github.com/confluentinc/kafka-connect-jdbc.git</connection> | ||
<developerConnection>scm:git:[email protected]:confluentinc/kafka-connect-jdbc.git</developerConnection> | ||
<url>https://github.com/confluentinc/kafka-connect-jdbc</url> | ||
<tag>v10.3.1</tag> | ||
<tag>v10.5.2</tag> | ||
</scm> | ||
|
||
<properties> | ||
<derby.version>10.14.2.0</derby.version> | ||
<commons-io.version>2.4</commons-io.version> | ||
<kafka.connect.maven.plugin.version>0.11.1</kafka.connect.maven.plugin.version> | ||
<sqlite-jdbc.version>3.25.2</sqlite-jdbc.version> | ||
<postgresql.version>42.2.19</postgresql.version> | ||
<oracle.jdbc.driver.version>19.7.0.0</oracle.jdbc.driver.version> | ||
<mssqlserver.jdbc.driver.version>8.4.1.jre8</mssqlserver.jdbc.driver.version> | ||
<postgresql.version>42.3.3</postgresql.version> | ||
<jtds.driver.version>1.3.1</jtds.driver.version> | ||
<slf4j.version>1.7.36</slf4j.version> | ||
<reload4j.version>1.2.19</reload4j.version> | ||
<licenses.name>Confluent Community License</licenses.name> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.package.home>target/${project.artifactId}-${project.version}-package</project.package.home> | ||
|
@@ -73,10 +76,10 @@ | |
<url>https://packages.confluent.io/maven/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>confluent</id> | ||
<name>Confluent</name> | ||
<url>https://packages.confluent.io/maven/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
@@ -121,7 +124,6 @@ | |
<groupId>com.microsoft.sqlserver</groupId> | ||
<artifactId>mssql-jdbc</artifactId> | ||
<version>${mssqlserver.jdbc.driver.version}</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>net.sourceforge.jtds</groupId> | ||
|
@@ -169,13 +171,14 @@ | |
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-log4j12</artifactId> | ||
<artifactId>slf4j-reload4j</artifactId> | ||
<version>${slf4j.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Use a repackaged version of log4j with security patches. Default log4j v1.2 is a transitive dependency of slf4j-log4j12, but it is excluded in common/pom.xml --> | ||
<dependency> | ||
<groupId>io.confluent</groupId> | ||
<artifactId>confluent-log4j</artifactId> | ||
<groupId>ch.qos.reload4j</groupId> | ||
<artifactId>reload4j</artifactId> | ||
<version>${reload4j.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
|
@@ -201,6 +204,12 @@ | |
<artifactId>connect-runtime</artifactId> | ||
<version>${kafka.version}</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-log4j12</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.kafka</groupId> | ||
|
@@ -270,6 +279,7 @@ | |
<configuration> | ||
<compilerArgs> | ||
<arg>-Xlint:all</arg> | ||
<arg>-Werror</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
|
Oops, something went wrong.