Skip to content

Commit e389979

Browse files
authored
Update README.md
1 parent f4863f4 commit e389979

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ This is made forLaravel Octane compatibility.
3232

3333
#### Setting initial event
3434

35-
You typically create a new initial event when you receive a HTTP request coming from a client you do not own. E.g in an API Gateway.
36-
There is a built-in `Ensi\LaravelInitialEventPropagation\SetInitialEventHttpMiddleware` for that.
37-
It creates an `InitialEventDTO` and places it to the `InitialEventHolder` singleton.
35+
You typically create a new initial event when you receive a HTTP request coming from a client you do not own. E.g in an API Gateway.
36+
There is a built-in `Ensi\LaravelInitialEventPropagation\SetInitialEventHttpMiddleware` for that.
37+
It creates an `InitialEventDTO` and places it to the `InitialEventHolder` singleton.
3838
- `userId` and `entrypoint` are set from request.
3939
- `app` is set according to config options.
4040
- `userType` is set from the package config. `userType` is empty for a not authenticated user.
4141
- `correlationId` and `timestamp` are set from request headers according to config options or generated from scratch.
4242
- `realUserId`, `realUserType` and `misc` are left empty strings.
4343

44-
Be sure to add the midlleware AFTER Laravel middleware that sets authenticated user.
44+
Be sure to add the midlleware AFTER Laravel middleware that sets authenticated user.
4545
In practice it likely means that you have to place the middleare at the very bottom of `middlewareGroups` in `app/Http/Kernel`
4646

4747
#### Parsing incoming initial event
4848

49-
Add `Ensi\LaravelInitialEventPropagation\ParseInitialEventHeaderMiddleware` to `app/Http/Kernel` middleware property.
49+
Add `Ensi\LaravelInitialEventPropagation\ParseInitialEventHeaderMiddleware` to `app/Http/Kernel` middleware property.
5050
This middleware parses `X-Initial-Event` HTTP header, deserializes it into `InitialEventDTO` object and places it to the `InitialEventHolder` singleton.
5151

5252
#### Propagating initial event to outcomming HTTP request
53-
The package provides a `Ensi\LaravelInitialEventPropagation\PropagateInitialEventLaravelGuzzleMiddleware` Guzzle Middleware that converts ` resolve(InitialEventHolder::class)->getInitialEvent()` back to `X-Initial-Event` header and sets this header for all outcomming guzzle request.
53+
The package provides a `Ensi\LaravelInitialEventPropagation\PropagateInitialEventLaravelGuzzleMiddleware` Guzzle Middleware that converts ` resolve(InitialEventHolder::class)->getInitialEvent()` back to `X-Initial-Event` header and sets this header for all outcomming guzzle request.
5454

5555
You can add it to your guzzle stack like this:
5656

@@ -73,13 +73,13 @@ public function bootstrap()
7373
(new SetInitialEventArtisanMiddleware())->handle();
7474
}
7575
```
76-
This middleware sets artisan command name (including argument, excluding options) as `$initialEventDTO->entrypoint`.
77-
If your custom artisan command makes guzzle HTTP requests to other apps the `PropagateInitialEventGuzzleMiddleware` uses this initial event.
76+
This middleware sets artisan command name (including argument, excluding options) as `$initialEventDTO->entrypoint`.
77+
If your custom artisan command makes guzzle HTTP requests to other apps the `PropagateInitialEventGuzzleMiddleware` uses this initial event.
7878
This middleware also works fine for [Laravel Task Scheduling](https://laravel.com/docs/latest/scheduling).
7979

8080
#### Queue Jobs
8181

82-
You typically want to persist initial event between incoming HTTP request and queued job.
82+
You typically want to persist initial event between incoming HTTP request and queued job.
8383
The package can help you here aswell. Unfortunately you need to touch a given job:
8484

8585
```php

0 commit comments

Comments
 (0)