From: sunil unnava Date: Tue, 8 Jan 2019 21:41:07 +0000 (-0500) Subject: add mmagent X-Git-Tag: 3.0.1-ONAP~7 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fkafka11aaf.git;a=commitdiff_plain;h=88c4aeab197aec7c4b2bba0f3595cc32a718d8cb add mmagent Issue-ID: DMAAP-909 Change-Id: Ib90bd5b62528fcec753e1f892797c8eb41c63062 Signed-off-by: sunil unnava --- diff --git a/pom.xml b/pom.xml index 3154bd5..e47c8c0 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ org.onap.dmaap.kafka kafka11aaf - 0.0.2-SNAPSHOT + 0.0.3-SNAPSHOT dmaap-kafka11aaf @@ -136,6 +136,53 @@ + + maven-dependency-plugin + + + copy + package + + copy + + + target + UTF-8 + + + org.onap.dmaap.messagerouter.mirroragent + dmaapMMAgent + 1.1.1-SNAPSHOT + dmaapMMAgent.jar + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-no-snapshots + + enforce + + + + + No Snapshots Allowed! + + org.onap.dmaap.messagerouter.mirroragent:dmaapMMAgent + + + + true + + + + com.spotify docker-maven-plugin @@ -157,6 +204,11 @@ ${project.build.directory} **/** + + / + ${project.build.directory} + dmaapMMAgent.jar + @@ -233,7 +285,7 @@ jar-with-dependencies - kafka11aaf + kafka11aaf @@ -246,13 +298,13 @@ - + UTF-8 - 0.0.2 + 0.0.3 /content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version} true true diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index 102ade0..9fad2b6 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -13,7 +13,11 @@ ADD truststoreONAPall.jks /tmp/truststoreONAPall.jks ADD org.onap.dmaap.mr.p12 /tmp/org.onap.dmaap.mr.p12 ADD keyfilenew /tmp/keyfilenew ADD cadi.properties /tmp/cadi.properties +ADD mmagent.config /opt/etc/mmagent.config +ADD consumer.properties /opt/etc/consumer.properties +ADD producer.properties /opt/etc/producer.properties ADD kafka11aaf-jar-with-dependencies.jar /tmp/kafka11aaf-jar-with-dependencies.jar +ADD dmaapMMAgent.jar /tmp/dmaapMMAgent.jar RUN chmod a+x /tmp/download-kafka.sh && sync && /tmp/download-kafka.sh && tar xfz /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka diff --git a/src/main/docker/consumer.properties b/src/main/docker/consumer.properties new file mode 100644 index 0000000..5ec6df2 --- /dev/null +++ b/src/main/docker/consumer.properties @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# see kafka.consumer.ConsumerConfig for more details + +# Zookeeper connection string +# comma separated host:port pairs, each corresponding to a zk +# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" +#zookeeper.connect=127.0.0.1:2181 + +# timeout in ms for connecting to zookeeper +#zookeeper.connection.timeout.ms=6000 + +#consumer group id +group.id=test-consumer-group + +#New MirrorMaker properties for Kafka 0.11 version +#Kafka 0.11 uses Kafka to manage consumers instead of ZK. +bootstrap.servers=127.0.0.1:9092 +client.id=mirror_maker_consumer + +#Following properties are required as MR 1.2 will use Kafka 0.11 with AAF Auth wrapper. +security.protocol=SASL_PLAINTEXT +sasl.mechanism=PLAIN +#java.security.auth.login.config=/opt/app/dmaap/mmagent/etc/kafka_client_jaas.conf +sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin_secret"; + + +#consumer timeout: +#consumer.timeout.ms=5000 diff --git a/src/main/docker/create-topics.sh b/src/main/docker/create-topics.sh index 34945b3..9b42fd1 100644 --- a/src/main/docker/create-topics.sh +++ b/src/main/docker/create-topics.sh @@ -1,5 +1,14 @@ #!/bin/bash +if [[ -n "$MM_AGENT_WAIT_TIME" ]]; then + ORD=$(eval $BROKER_ID_COMMAND) + if [ "$ORD" = "0" ]; then + echo "wait for $MM_AGENT_WAIT_TIME before start of the mirror maker agent" + sleep $MM_AGENT_WAIT_TIME + java -jar /tmp/dmaapMMAgent.jar + fi +fi + if [[ -z "$START_TIMEOUT" ]]; then START_TIMEOUT=600 diff --git a/src/main/docker/mmagent.config b/src/main/docker/mmagent.config new file mode 100644 index 0000000..0270a86 --- /dev/null +++ b/src/main/docker/mmagent.config @@ -0,0 +1,5 @@ +kafkahome=/opt/kafka +topicURL=http://message-router:3904 +topicname=org.onap.dmaap.mr.mmagent +mechid=demo@people.osaaf.org +password=YKCAVhSQ+nedsh1Nry57l19jJQSnk8gs \ No newline at end of file diff --git a/src/main/docker/producer.properties b/src/main/docker/producer.properties new file mode 100644 index 0000000..78ff7c7 --- /dev/null +++ b/src/main/docker/producer.properties @@ -0,0 +1,70 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# see kafka.producer.ProducerConfig for more details + +############################# Producer Basics ############################# + +# list of brokers used for bootstrapping knowledge about the rest of the cluster +# format: host1:port1,host2:port2 ... +#metadata.broker.list=172.16.96.14:9092 + +# name of the partitioner class for partitioning events; default partition spreads data randomly +#partitioner.class= + +# specifies whether the messages are sent asynchronously (async) or synchronously (sync) +producer.type=sync + +# specify the compression codec for all data generated: none, gzip, snappy, lz4. +# the old config values work as well: 0, 1, 2, 3 for none, gzip, snappy, lz4, respectively +#compression.codec=none + +# message encoder +#serializer.class=kafka.serializer.DefaultEncoder + +# allow topic level compression +#compressed.topics= + +#New MirrorMaker properties for Kafka 0.11 version +#list of brokers used for bootstrapping knowledge about the rest of the cluster +# format: host1:port1,host2:port2 ... +bootstrap.servers=172.16.96.14:9092 + +#Following properties are required as MR 1.2 will use Kafka 0.11 with AAF Auth wrapper. +security.protocol=SASL_PLAINTEXT +sasl.mechanism=PLAIN +#java.security.auth.login.config=/opt/app/dmaap/mmagent/etc/kafka_client_jaas.conf +sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="admin_secret"; + +#Producer +compression.type=none +#serializer.class=kafka.serializer.DefaultEncoder +batch.size=100 +client.id=mirror_maker_producer + +############################# Async Producer ############################# +# maximum time, in milliseconds, for buffering data on the producer queue +#queue.buffering.max.ms= + +# the maximum size of the blocking queue for buffering on the producer +#queue.buffering.max.messages= + +# Timeout for event enqueue: +# 0: events will be enqueued immediately or dropped if the queue is full +# -ve: enqueue will block indefinitely if the queue is full +# +ve: enqueue will block up to this many milliseconds if the queue is full +#queue.enqueue.timeout.ms= + +# the number of messages batched at the producer +#batch.num.messages= diff --git a/src/main/docker/start-kafka.sh b/src/main/docker/start-kafka.sh index 587905d..16deb48 100644 --- a/src/main/docker/start-kafka.sh +++ b/src/main/docker/start-kafka.sh @@ -143,6 +143,8 @@ cp /tmp/cadi.properties $KAFKA_HOME/config export KAFKA_OPTS="-Djava.security.auth.login.config=$KAFKA_HOME/config/kafka_server_jaas.conf" - echo "10.12.6.214 aaf-onap-beijing-test aaf-onap-beijing-test.osaaf.org aaf-onap-test.osaaf.org" >> /etc/hosts exec $KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties + + + diff --git a/version.properties b/version.properties index 96247dc..a34946a 100644 --- a/version.properties +++ b/version.properties @@ -26,7 +26,7 @@ major=0 minor=0 -patch=2 +patch=3 base_version=${major}.${minor}.${patch}