summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsunil unnava <sunil.unnava@att.com>2019-01-08 16:41:07 -0500
committersunil unnava <su622b@att.com>2019-01-09 04:27:18 +0000
commit88c4aeab197aec7c4b2bba0f3595cc32a718d8cb (patch)
tree7aa7acdb5dc2c926ea2dad10647d3b4dd74a6554 /src
parent244dda1d092ca7c2eacdc7dca8f063d44edd7dee (diff)
add mmagent
Issue-ID: DMAAP-909 Change-Id: Ib90bd5b62528fcec753e1f892797c8eb41c63062 Signed-off-by: sunil unnava <sunil.unnava@att.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/docker/Dockerfile4
-rw-r--r--src/main/docker/consumer.properties41
-rw-r--r--src/main/docker/create-topics.sh9
-rw-r--r--src/main/docker/mmagent.config5
-rw-r--r--src/main/docker/producer.properties70
-rw-r--r--src/main/docker/start-kafka.sh4
6 files changed, 132 insertions, 1 deletions
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
+
+
+