maritechpro / rpc-amqp-server
RPC API 组件包
1.0.0
2020-12-14 14:35 UTC
Requires
- php: ^7.4
- ext-amqp: *
- gepur-it/rabbitmq-bundle: ^5.0
- symfony/config: ^4.3|^5.0
- symfony/dependency-injection: ^4.3|^5.0
- symfony/http-kernel: ^4.3|^5.0
- symfony/yaml: ^4.3|^5.0
Requires (Dev)
- vimeo/psalm: ^3.4
This package is auto-updated.
Last update: 2024-09-20 21:47:40 UTC
README
您只应创建请求和操作
example of /config/packages/rpc_api.yaml
rpc_api:
services:
GepurIt\RpcApiBundle\Rabbit\ConsumerExchangeProviderInterface:
alias: 'rpc.provider.client_api'
rpc.provider.client_api:
class: GepurIt\RpcApiBundle\Rabbit\ConsumerExchangeProvider
arguments: ['@rabbit_mq', 'client_api_rpc']
public: true
GepurIt\RpcApiBundle\Request\RequestDataResolver:
autowire: true
calls:
- {method: registerRequest, arguments: ['predictDiscount','App\RpcApi\Request\PredictDiscountRequestData']}
- {method: registerRequest, arguments: ['updateLoyalty','App\RpcApi\Request\UpdateLoyaltyRequestData']}
GepurIt\RpcApiBundle\Actions\ActionFactory:
autowire: true
calls:
- {method: registerAction, arguments: ['predictDiscount','@App\RpcApi\Action\PredictDiscountAction']}
- {method: registerAction, arguments: ['updateLoyalty','@App\RpcApi\Action\UpdateLoyaltyAction']}
App\RpcApi\Action\:
resource: '../../src/RpcApi/Action'
autowire: true