Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Config kafka-connect-redis test to run all its services on custom ports.
Browse files Browse the repository at this point in the history
Signed-off-by: Marios Andreopoulos <opensource@andmarios.com>
  • Loading branch information
andmarios committed Oct 5, 2016
1 parent 2ef0357 commit 9bb6c6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
15 changes: 8 additions & 7 deletions kafka-connect-redis/coyote.yml
Expand Up @@ -18,7 +18,7 @@
- name: Create Topic
command: >
docker run --rm --net=host landoop/fast-data-dev
kafka-topics --zookeeper localhost:2181 --topic person_redis --partition 1 --replication 1 --create
kafka-topics --zookeeper localhost:52181 --topic person_redis --partition 1 --replication 1 --create
- name: Create Redis Connector Configuration
command: tee redis-connector.properties.json
stdin: |
Expand All @@ -29,7 +29,7 @@
"tasks.max": "1",
"topics": "person_redis",
"connect.redis.connection.host": "redis",
"connect.redis.connection.port": "6379",
"connect.redis.connection.port": "56379",
"connect.redis.connection.password": "pass",
"connect.redis.export.route.query": "INSERT INTO TABLE1 SELECT * FROM person_redis"
}
Expand All @@ -38,7 +38,7 @@
command: >
curl -vs --stderr - -X POST -H "Content-Type: application/json"
--data @redis-connector.properties.json
"http://localhost:8083/connectors"
"http://localhost:58083/connectors"
stdout_not_has: [ 'HTTP/1.1 [45][0-9][0-9] ' ]
- command: sleep 20
nolog: true
Expand All @@ -48,8 +48,9 @@
- name: Write Entries into Topic
command: >
docker run --rm -i --net=host landoop/fast-data-dev
kafka-avro-console-producer --broker-list localhost:9092
--topic person_redis --property
kafka-avro-console-producer --broker-list localhost:59092
--topic person_redis --property schema.registry.url="http://localhost:58081"
--property
value.schema='{"type":"record","name":"User","namespace":"com.datamountaineer.streamreactor.connect.redis","fields":[{"name":"firstName","type":"string"},{"name":"lastName","type":"string"},{"name":"age","type":"int"},{"name":"salary","type":"double"}]}'
stdin: |
{"firstName": "%UNIQUE_NAME1%", "lastName": "%UNIQUE_NAME2%", "age":30, "salary": 4830}
Expand All @@ -58,10 +59,10 @@
- command: sleep 20
nolog: true
- name: Verify entry 1
command: docker run --rm --net=host redis redis-cli -h 127.0.0.1 -a pass get "person_redis|0|0"
command: docker run --rm --net=host redis redis-cli -h 127.0.0.1 -p 56379 -a pass get "person_redis|0|0"
stdout_has: [ '%UNIQUE_NAME1%', '%UNIQUE_NAME2%' ]
- name: Verify entry 2
command: docker run --rm --net=host redis redis-cli -h 127.0.0.1 -a pass get "person_redis|0|1"
command: docker run --rm --net=host redis redis-cli -h 127.0.0.1 -p 56379 -a pass get "person_redis|0|1"
stdout_has: [ '%UNIQUE_NAME3%', '%UNIQUE_NAME4%' ]

- name: Clean-up Containers
Expand Down
22 changes: 14 additions & 8 deletions kafka-connect-redis/docker-compose.yml
Expand Up @@ -3,22 +3,28 @@ services:
fast-data-dev:
image: landoop/fast-data-dev
ports:
- 9092:9092
- 8081:8081
- 8082:8082
- 8083:8083
- 2181:2181
- 3030:3030
- 59092:59092
- 58081:58081
- 58082:58082
- 58083:58083
- 52181:52181
- 53030:53030
depends_on:
- redis
environment:
- ADV_HOST=localhost
- ZK_PORT=52181
- BROKER_PORT=59092
- REGISTRY_PORT=58081
- REST_PORT=58082
- CONNECT_PORT=58083
- WEB_PORT=53030
redis:
image: redis
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
expose:
- 6379
- 56379
ports:
- 6379:6379
- 56379:56379
command: redis-server /usr/local/etc/redis/redis.conf
1 change: 1 addition & 0 deletions kafka-connect-redis/redis.conf
@@ -1,3 +1,4 @@
requirepass pass
bind 0.0.0.0
protected-mode no
port 56379

0 comments on commit 9bb6c6e

Please sign in to comment.