2017 © Pedro Peláez
 

symfony-bridge message-http-adapter

HTTP adapter for Symfony Message component

image

sroze/message-http-adapter

HTTP adapter for Symfony Message component

  • Monday, October 9, 2017
  • by sroze
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

HTTP adapter for Symfony's Message component

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., (*1)

Usage

They are two scenarios: - Receive HTTP messages - Send HTTP messages, (*2)

Receive HTTP messages

  1. 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'
  1. Configure Symfony's router to use your HTTP consumers
# app/config/routing.yml
http_messages:
    resource: .
    type: http_messages
  1. Send your HTTP request!
curl 'http://localhost:8000/api/do-something' \
    -X POST \
    --data-binary '{"propertyOfDoSomethingObject": "yourValue"}' --compressed

Send HTTP messages

  1. Configure the producer
# config/packages/message_http_adapter.yaml
message_http_adapter:
    producers:
        requestbin:
            endpoint: 'https://requestb.in/pdjzjmpd'
  1. Route messages to the HTTP adapter producers
# config/packages/
framework:
    message:
        routing:
            'App\Message\Send3rdPartyNotification': message_http_adapter.producer.requestbin

The Versions

09/10 2017

dev-master

9999999-dev http://symfony.com

HTTP adapter for Symfony Message component

  Sources   Download

MIT

The Requires

 

symfony guzzle message