Skip to content

Commit

Permalink
docs: add upgrade guide
Browse files Browse the repository at this point in the history
  • Loading branch information
hcdias committed Apr 5, 2023
1 parent e51273f commit 5a3fcda
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<a name="upgrade-guide"></a>
## Upgrade guide

To upgrade from version X.x to version X.y:

Move your `avroschema` and `broker` section from old `config/kafka.php` file into a new file:


```php
<?php
// config/service.php
return [
'topics' => [
'this_is_your_topic_name' => [
'topic_id' => "this_is_your_topic_id",
'consumer' => [
'consumer_group' => 'your-consumer-group',
'offset_reset' => 'earliest',
'offset' => 0,
'partition' => 0,
'handler' => '\App\Kafka\Consumers\ConsumerExample',
'timeout' => 20000,
'auto_commit' => true,
'commit_async' => false,
'middlewares' => [],
],

'producer' => [
'required_acknowledgment' => true,
'is_async' => true,
'max_poll_records' => 500,
'flush_attempts' => 10,
'middlewares' => [],
'timeout' => 10000,
'partition' => constant('RD_KAFKA_PARTITION_UA') ?? -1,
],
]
],
];
```

Upgrade your topic configuration files:

```php
<?php
// config/kafka.php
return [
'topics' => [
'this_is_your_topic_name' => [
'topic_id' => "this_is_your_topic_id",
'consumer' => [
'consumer_group' => 'your-consumer-group',
'offset_reset' => 'earliest',
'offset' => 0,
'partition' => 0,
'handler' => '\App\Kafka\Consumers\ConsumerExample',
'timeout' => 20000,
'auto_commit' => true,
'commit_async' => false,
'middlewares' => [],
],

'producer' => [
'required_acknowledgment' => true,
'is_async' => true,
'max_poll_records' => 500,
'flush_attempts' => 10,
'middlewares' => [],
'timeout' => 10000,
'partition' => constant('RD_KAFKA_PARTITION_UA') ?? -1,
],
]
],
];
```

0 comments on commit 5a3fcda

Please sign in to comment.