-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mhfereydouni/handle_event_consumes_which_e…
…ncounter_an_error add error handling protocol for event consumer
- Loading branch information
Showing
5 changed files
with
82 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,3 @@ | ||
# Changelog | ||
|
||
All notable changes to `:package_name` will be documented in this file. | ||
|
||
## Add vhost option & read configs from env - 2023-04-11 | ||
|
||
- added vhost option | ||
- configs to target env | ||
|
||
## Laravel 10 & PHP 8.1 support - 2023-03-12 | ||
|
||
drop support for laravel < 10 | ||
drop support for PHP < 8.1 | ||
cleaner syntax for consumer configuration | ||
|
||
## Changed config and added document for package - 2023-03-06 | ||
|
||
- changed config to be more intuitive | ||
- document usage of package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace MHFereydouni\RabbitMQ\Support; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class EventJobWrapper implements ShouldQueue | ||
{ | ||
use Dispatchable; | ||
use InteractsWithQueue; | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
public function __construct( | ||
public string $event, | ||
public array $payload | ||
) {} | ||
|
||
public function handle(): void | ||
{ | ||
event(resolve($this->event, $this->payload)); | ||
} | ||
|
||
public function viaQueue(): string | ||
{ | ||
return config('rabbitmq.queue-name', 'default'); | ||
} | ||
} |