Example #1
0
 /**
  * @param Request $request
  * @return array
  */
 private function createAttributes(Request $request) : array
 {
     $attributes = ['content_type' => 'application/json', 'content_encoding' => 'UTF-8', 'delivery_mode' => 2, 'type' => $request->method(), 'timestamp' => $request->timestamp(), 'reply_to' => $this->queue->getName(), 'app_id' => $this->appId, 'user_id' => $this->queue->getConnection()->getOptions()->getLogin(), 'headers' => ['jsonrpc' => JsonRpcRequest::JSONRPC_VERSION]];
     if (null !== $request->id()) {
         $attributes['correlation_id'] = $request->id();
     }
     if (0 < $request->expiration()) {
         $attributes['expiration'] = $request->expiration();
     }
     return $attributes;
 }