add mmagent 01/75501/3
authorsunil unnava <sunil.unnava@att.com>
Tue, 8 Jan 2019 21:41:07 +0000 (16:41 -0500)
committersunil unnava <su622b@att.com>
Wed, 9 Jan 2019 04:27:18 +0000 (04:27 +0000)
Issue-ID: DMAAP-909
Change-Id: Ib90bd5b62528fcec753e1f892797c8eb41c63062
Signed-off-by: sunil unnava <sunil.unnava@att.com>
pom.xml
src/main/docker/Dockerfile
src/main/docker/consumer.properties [new file with mode: 0644]
src/main/docker/create-topics.sh
src/main/docker/mmagent.config [new file with mode: 0644]
src/main/docker/producer.properties [new file with mode: 0644]
src/main/docker/start-kafka.sh
version.properties

diff --git a/pom.xml b/pom.xml
index 3154bd5..e47c8c0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
 
        <groupId>org.onap.dmaap.kafka</groupId>
        <artifactId>kafka11aaf</artifactId>
-       <version>0.0.2-SNAPSHOT</version>
+       <version>0.0.3-SNAPSHOT</version>
        <name>dmaap-kafka11aaf</name>
        <licenses>
                <license>
                                        <skip />
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <artifactId>maven-dependency-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>copy</id>
+                                               <phase>package</phase>
+                                               <goals>
+                                                       <goal>copy</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <outputDirectory>target</outputDirectory>
+                                                       <encoding>UTF-8</encoding>
+                                                       <artifactItems>
+                                                               <artifactItem>
+                                                                       <groupId>org.onap.dmaap.messagerouter.mirroragent</groupId>
+                                                                       <artifactId>dmaapMMAgent</artifactId>
+                                                                       <version>1.1.1-SNAPSHOT</version>
+                                                                       <destFileName>dmaapMMAgent.jar</destFileName>
+                                                               </artifactItem>
+                                                       </artifactItems>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-enforcer-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>enforce-no-snapshots</id>
+                                               <goals>
+                                                       <goal>enforce</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <rules>
+                                                               <requireReleaseDeps>
+                                                                       <message>No Snapshots Allowed!</message>
+                                                                       <excludes>
+                                                                               <exclude>org.onap.dmaap.messagerouter.mirroragent:dmaapMMAgent</exclude>
+                                                                       </excludes>
+                                                               </requireReleaseDeps>
+                                                       </rules>
+                                                       <fail>true</fail>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <groupId>com.spotify</groupId>
                                <artifactId>docker-maven-plugin</artifactId>
                                                        <directory>${project.build.directory}</directory>
                                                        <include>**/**</include>
                                                </resource>
+                                               <resource>
+                                                       <targetPath>/</targetPath>
+                                                       <directory>${project.build.directory}</directory>
+                                                       <include>dmaapMMAgent.jar</include>
+                                               </resource>
                                        </resources>
                                </configuration>
                                <executions>
                                                <descriptorRef>jar-with-dependencies</descriptorRef>
                                        </descriptorRefs>
                                        <!-- MainClass in mainfest make a executable jar -->
-                 <finalName>kafka11aaf</finalName>
+                                       <finalName>kafka11aaf</finalName>
                                </configuration>
                                <executions>
                                        <execution>
                                        </execution>
                                </executions>
                        </plugin>
-                       
+
                </plugins>
        </build>
 
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-               <KafkaImg>0.0.2</KafkaImg>
+               <KafkaImg>0.0.3</KafkaImg>
                <sitePath>/content/sites/site/org/onap/dmaap/kafka0111/${project.artifactId}/${project.version}</sitePath>
                <skip.docker.build>true</skip.docker.build>
                <skip.docker.push>true</skip.docker.push>
index 102ade0..9fad2b6 100644 (file)
@@ -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 (file)
index 0000000..5ec6df2
--- /dev/null
@@ -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
index 34945b3..9b42fd1 100644 (file)
@@ -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 (file)
index 0000000..0270a86
--- /dev/null
@@ -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 (file)
index 0000000..78ff7c7
--- /dev/null
@@ -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=
index 587905d..16deb48 100644 (file)
@@ -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
+
+
+
index 96247dc..a34946a 100644 (file)
@@ -26,7 +26,7 @@
 
 major=0
 minor=0
-patch=2
+patch=3
 
 base_version=${major}.${minor}.${patch}