sroze / message-http-adapter
HTTP adapter for Symfony Message component
Package info
github.com/sroze/message-http-adapter
Type:symfony-bridge
pkg:composer/sroze/message-http-adapter
dev-master / 1.0.x-dev
2017-10-09 09:40 UTC
Requires
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2026-03-01 00:24:04 UTC
README
Messages can also come from HTTP messages or go to other APIs through HTTP requests. This adapter will help you doing so in a very easy manner with the Symfony Message component.
Usage
They are two scenarios:
Receive HTTP messages
- Configure the adapter to receive your messages
# config/packages/message_http_adapter.yaml message_http_adapter: consumers: - path: '/api/do-something' message: 'App\Message\DoSomething'
- Configure Symfony's router to use your HTTP consumers
# app/config/routing.yml http_messages: resource: . type: http_messages
- Send your HTTP request!
curl 'http://localhost:8000/api/do-something' \
-X POST \
--data-binary '{"propertyOfDoSomethingObject": "yourValue"}' --compressed
Send HTTP messages
- Configure the producer
# config/packages/message_http_adapter.yaml message_http_adapter: producers: requestbin: endpoint: 'https://requestb.in/pdjzjmpd'
- Route messages to the HTTP adapter producers
# config/packages/ framework: message: routing: 'App\Message\Send3rdPartyNotification': message_http_adapter.producer.requestbin