Skip to content

Commit 9a372cc

Browse files
Kafka Transport Bridge
1 parent bb6e4da commit 9a372cc

21 files changed

+1073
-4
lines changed

.github/workflows/docker-compose.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
version: "3.9"
2+
services:
3+
postgres:
4+
image: postgres:9.6-alpine
5+
ports:
6+
- 5432:5432
7+
environment:
8+
POSTGRES_PASSWORD: 'password'
9+
ldap:
10+
image: bitnami/openldap
11+
ports:
12+
- 3389:3389
13+
environment:
14+
LDAP_ADMIN_USERNAME: admin
15+
LDAP_ADMIN_PASSWORD: symfony
16+
LDAP_ROOT: dc=symfony,dc=com
17+
LDAP_PORT_NUMBER: 3389
18+
LDAP_USERS: a
19+
LDAP_PASSWORDS: a
20+
redis:
21+
image: redis:6.0.0
22+
ports:
23+
- 16379:6379
24+
redis-cluster:
25+
image: grokzen/redis-cluster:5.0.4
26+
ports:
27+
- 7000:7000
28+
- 7001:7001
29+
- 7002:7002
30+
- 7003:7003
31+
- 7004:7004
32+
- 7005:7005
33+
- 7006:7006
34+
environment:
35+
STANDALONE: 1
36+
redis-sentinel:
37+
image: bitnami/redis-sentinel:6.0
38+
ports:
39+
- 26379:26379
40+
environment:
41+
REDIS_MASTER_HOST: redis
42+
REDIS_MASTER_SET: redis_sentinel
43+
REDIS_SENTINEL_QUORUM: 1
44+
memcached:
45+
image: memcached:1.6.5
46+
ports:
47+
- 11211:11211
48+
rabbitmq:
49+
image: rabbitmq:3.8.3
50+
ports:
51+
- 5672:5672
52+
mongodb:
53+
image: mongo
54+
ports:
55+
- 27017:27017
56+
couchbase:
57+
image: couchbase:6.5.1
58+
ports:
59+
- 8091:8091
60+
- 8092:8092
61+
- 8093:8093
62+
- 8094:8094
63+
- 11210:11210
64+
sqs:
65+
image: asyncaws/testing-sqs
66+
ports:
67+
- 9494:9494
68+
zookeeper:
69+
image: wurstmeister/zookeeper:3.4.6
70+
kafka:
71+
image: wurstmeister/kafka:2.12-2.0.1
72+
ports:
73+
- 9092:9092
74+
environment:
75+
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
76+
KAFKA_CREATE_TOPICS: 'test-topic:1:1:compact'
77+
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
78+
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
79+
KAFKA_ADVERTISED_PORT: 9092
80+

.github/workflows/integration-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
ports:
9999
- 9092:9092
100100
env:
101-
KAFKA_AUTO_CREATE_TOPICS_ENABLE: false
101+
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
102102
KAFKA_CREATE_TOPICS: 'test-topic:1:1:compact'
103103
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.1
104104
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
@@ -177,6 +177,7 @@ jobs:
177177
MESSENGER_AMQP_DSN: amqp://localhost/%2f/messages
178178
MESSENGER_SQS_DSN: "sqs://localhost:9494/messages?sslmode=disable&poll_timeout=0.01"
179179
MESSENGER_SQS_FIFO_QUEUE_DSN: "sqs://localhost:9494/messages.fifo?sslmode=disable&poll_timeout=0.01"
180+
MESSENGER_KAFKA_DSN: kafka://localhost:9092
180181
KAFKA_BROKER: 127.0.0.1:9092
181182
POSTGRES_HOST: localhost
182183

.github/workflows/psalm.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ jobs:
2020
runs-on: Ubuntu-20.04
2121

2222
steps:
23-
- name: Setup PHP
23+
- name: Install system dependencies
24+
run: sudo apt-get update && sudo apt-get install librdkafka-dev
25+
26+
- name: Set up PHP
2427
uses: shivammathur/setup-php@v2
2528
with:
2629
php-version: '8.1'
27-
extensions: "json,couchbase,memcached,mongodb,redis,xsl,ldap,dom"
30+
extensions: "json,couchbase,memcached,mongodb,redis,xsl,ldap,dom,rdkafka"
2831
ini-values: "memory_limit=-1"
2932
coverage: none
3033

.github/workflows/unit-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: Tests
2222

2323
env:
24-
extensions: amqp,apcu,igbinary,intl,mbstring,memcached,redis
24+
extensions: amqp,apcu,igbinary,intl,mbstring,memcached,redis,rdkafka
2525

2626
strategy:
2727
matrix:
@@ -43,6 +43,9 @@ jobs:
4343
with:
4444
fetch-depth: 2
4545

46+
- name: Install system dependencies
47+
run: sudo apt-get update && sudo apt-get install librdkafka-dev
48+
4649
- name: Setup PHP
4750
uses: shivammathur/setup-php@v2
4851
with:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CHANGELOG
2+
=========
3+
4+
6.3
5+
---
6+
7+
* Add the bridge
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2022 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Kafka Messenger
2+
===============
3+
4+
Provides Kafka integration for Symfony Messenger.
5+
6+
Resources
7+
---------
8+
9+
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
10+
* [Report issues](https://github.com/symfony/symfony/issues) and
11+
[send Pull Requests](https://github.com/symfony/symfony/pulls)
12+
in the [main Symfony repository](https://github.com/symfony/symfony)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Symfony\Component\Messenger\Bridge\Kafka\Tests\Fixtures;
4+
5+
class TestMessage
6+
{
7+
public function __construct(
8+
public ?string $data = null
9+
){
10+
}
11+
}

0 commit comments

Comments
 (0)