{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/28164","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/28164/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/28164/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/28164/events","html_url":"https://github.com/symfony/symfony/issues/28164","id":348735755,"node_id":"MDU6SXNzdWUzNDg3MzU3NTU=","number":28164,"title":"Envelope in symfony/messenger supports only PHP serializable objects","user":{"login":"covobo","id":6328862,"node_id":"MDQ6VXNlcjYzMjg4NjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6328862?v=4","gravatar_id":"","url":"https://api.github.com/users/covobo","html_url":"https://github.com/covobo","followers_url":"https://api.github.com/users/covobo/followers","following_url":"https://api.github.com/users/covobo/following{/other_user}","gists_url":"https://api.github.com/users/covobo/gists{/gist_id}","starred_url":"https://api.github.com/users/covobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/covobo/subscriptions","organizations_url":"https://api.github.com/users/covobo/orgs","repos_url":"https://api.github.com/users/covobo/repos","events_url":"https://api.github.com/users/covobo/events{/privacy}","received_events_url":"https://api.github.com/users/covobo/received_events","type":"User","site_admin":false},"labels":[{"id":100378,"node_id":"MDU6TGFiZWwxMDAzNzg=","url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":877085690,"node_id":"MDU6TGFiZWw4NzcwODU2OTA=","url":"https://api.github.com/repos/symfony/symfony/labels/Messenger","name":"Messenger","color":"dddddd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-08T13:52:00Z","updated_at":"2018-08-12T17:04:46Z","closed_at":null,"author_association":"NONE","body":"**Description**  \r\nWhy does symfony/messenger/Envelope.php (https://github.com/symfony/messenger/blob/master/Envelope.php) support only complex types (classes)? Look at 34 line there is get_class method which makes impossible to use primitive types (like string or boolean).\r\nIt's a problem because symfony doesn't support any other header data (it parses only X-Message-Envelope-Items header). How do I share header information between a few microservices? \r\n\r\n**Example**  \r\n\r\nIf we really want to support only EnvelopeItemInterface items, it's still easy to implement primitives.\r\n\r\nThere is example:\r\n```\r\npublic function __construct($message, array $items = array())\r\n{\r\n        $this->message = $message;\r\n        foreach ($items as $item) {\r\n            if (!is_object($item)) {\r\n                      switch (detect_type($item)) {\r\n                              case TYPE_BOOLEAN:\r\n                                       $item = new EnvelopeItemBoolean($item);\r\n                              break;\r\n                              case TYPE_STRING:\r\n                                       $item = new EnvelopeItemString($item);\r\n                              break;\r\n                             // ..array, int, null\r\n                      }\r\n            }\r\n            $this->items[\\get_class($item)] = $item;\r\n        }\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/412356731","html_url":"https://github.com/symfony/symfony/issues/28164#issuecomment-412356731","issue_url":"https://api.github.com/repos/symfony/symfony/issues/28164","id":412356731,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjM1NjczMQ==","user":{"login":"sroze","id":804625,"node_id":"MDQ6VXNlcjgwNDYyNQ==","avatar_url":"https://avatars0.githubusercontent.com/u/804625?v=4","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false},"created_at":"2018-08-12T17:04:46Z","updated_at":"2018-08-12T17:04:46Z","author_association":"MEMBER","body":"I believe as well that we should allow having these envelope items being (de)serialized using Symfony's Serializer component. Such a change not being retro-compatible with previous events and have the drawbacks discussed in the PR mentioned earlier, I believe that we need to introduce it as an opt-in. "}}
{"actor":{"display_login":"sroze"}}