Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GKarman/hw19 rabbit-mq #1165

Open
wants to merge 15 commits into
base: GKarman/main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.idea
mysql/dbdata/*
code/*
.env
php-fpm/socket/*
hw19/code/vendor
hw19/code/.idea


37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# PHP_2023

https://otus.ru/lessons/razrabotchik-php/?utm_source=github&utm_medium=free&utm_campaign=otus
1. Скачать проект

```
git clone [email protected]:otusteamedu/PHP_2023.git
```
2. Зайти в папку проекта и выполнить

```
git checkout GKarman/hw-19-rabbitMQ
cd hw19/docker
docker-compose up -d
```

3. consumer стартует автоматически в отдельном контейнере

4. Посылаем post запрос наример через postman
- на хост http://app.loc/
- формат json поля
- email_to
- create_date_from
- create_date_to

пример запроса
```
curl --location 'http://app.loc/' \
--form 'email_to="[email protected]"' \
--form 'create_date_from="2024-01-01"' \
--form 'create_date_to="2024-01-30"'
```

5. Заходим в терминал с php-fpm и видим там вывод нашего сообщения из очереди

```
[x] Received O:69:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\Entity\OrderReportRequest":4:{s:77:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\Entity\OrderReportRequestuserId";O:58:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\Id":1:{s:62:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\Idid";i:1;}s:79:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\Entity\OrderReportRequestdateFrom";O:70:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateFrom":1:{s:80:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateFromdateFrom";O:8:"DateTime":3:{s:4:"date";s:26:"2024-01-01 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}}s:77:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\Entity\OrderReportRequestdateTo";O:68:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateTo":1:{s:76:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\ReportDateTodateTo";O:8:"DateTime":3:{s:4:"date";s:26:"2024-01-30 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}}s:78:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\Entity\OrderReportRequestemailTo";O:61:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\Email":1:{s:68:"Gkarman\Rabbitmq\Modules\OrderReport\Domain\ValueObject\Emailemail";s:12:"[email protected]";}}
```
13 changes: 13 additions & 0 deletions hw19/code/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "gkarman/rabbitmq",
"type": "project",
"autoload": {
"psr-4": {
"Gkarman\\Rabbitmq\\": "src/"
}
},
"require": {
"ext-mbstring": "*",
"php-amqplib/php-amqplib": "^3.2"
}
}
329 changes: 329 additions & 0 deletions hw19/code/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading