{"action":"created","issue":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/547","repository_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ","labels_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/547/labels{/name}","comments_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/547/comments","events_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/547/events","html_url":"https://github.com/EasyNetQ/EasyNetQ/issues/547","id":133962014,"number":547,"title":"Hosepipe re-publishes messages with headers base64 encoded","user":{"login":"danbarua","id":469192,"avatar_url":"https://avatars.githubusercontent.com/u/469192?v=3","gravatar_id":"","url":"https://api.github.com/users/danbarua","html_url":"https://github.com/danbarua","followers_url":"https://api.github.com/users/danbarua/followers","following_url":"https://api.github.com/users/danbarua/following{/other_user}","gists_url":"https://api.github.com/users/danbarua/gists{/gist_id}","starred_url":"https://api.github.com/users/danbarua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbarua/subscriptions","organizations_url":"https://api.github.com/users/danbarua/orgs","repos_url":"https://api.github.com/users/danbarua/repos","events_url":"https://api.github.com/users/danbarua/events{/privacy}","received_events_url":"https://api.github.com/users/danbarua/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-16T11:55:51Z","updated_at":"2016-02-17T10:26:25Z","closed_at":null,"body":"When EasyNetQ.Hosepipe is used to write out error messages to disc, the headers are written out base64 encoded:\r\n\r\n```json\r\n{\r\n    \"BasicProperties\": {\r\n        \"AppIdPresent\": false,\r\n        \"ClusterIdPresent\": false,\r\n        \"ContentEncodingPresent\": false,\r\n        \"ContentTypePresent\": false,\r\n        \"CorrelationId\": \"\",\r\n        \"CorrelationIdPresent\": true,\r\n        \"DeliveryMode\": 0,\r\n        \"DeliveryModePresent\": false,\r\n        \"ExpirationPresent\": false,\r\n        \"Headers\": {\r\n            \"ClientIpAddress\": \"TWk0eE1ERXVNakExTGpFME5BPT0=\",\r\n            \"SessionId\": \"ZUZkalprdzBSSGs1YlhFNFZFWlJjM0F6Ylc4PQ==\",\r\n            \"UserId\": \"TVdVeFpXVTFPVFV0TmpoaU9DMHhNV1UwTFdFMlltWXROMlpqTVRNME1qRXpPRGhs\",\r\n            \"UserName\": \"YzJGdVpISmhMbVZuWldGQWRtOXNhM04zWVdkbGJuWnZhV05sTG1OdkxuVnI=\"\r\n        },\r\n        \"HeadersPresent\": true,\r\n        \"MessageIdPresent\": false,\r\n        \"Priority\": 0,\r\n        \"PriorityPresent\": false,\r\n        \"ReplyToPresent\": false,\r\n        \"Timestamp\": 0,\r\n        \"TimestampPresent\": false,\r\n        \"Type\": \"TTL_Digivoice_Domain_Commands_Calls_SetCritiqueStatus:TTL_Digivoice_Domain\",\r\n        \"TypePresent\": true,\r\n        \"UserIdPresent\": false\r\n    },\r\n    \"DateTime\": \"2016-02-16T11:23:29.2443164Z\",\r\n    \"Exception\": \"System.AggregateException: One or more errors occurred. ---> BLAH BLAH BLAH MASSIVE STACKTRACE\",\r\n    \"Exchange\": \"TTL_Digivoice_Domain_Commands_Calls_SetCritiqueStatus:TTL_Digivoice_Domain\",\r\n    \"Message\": \"{\\\"__type\\\":\\\"TTL.Digivoice.Domain.Commands.Calls.SetCritiqueStatus, TTL.Digivoice.Domain\\\",\\\"Id\\\":12850567,\\\"Status\\\":\\\"NotValid\\\"}\",\r\n    \"RoutingKey\": \"TTL_Digivoice_Domain_Commands_Calls_SetCritiqueStatus:TTL_Digivoice_Domain\"\r\n}\r\n```\r\n\r\nWhen these error messages are retried, the message is subsequently published to the exchange with the headers still base64 encoded.\r\n\r\nFixing this would be a breaking change in terms of behaviour, but I suspect that if anybody was relying on data in the headers then they would have come across this issue as well.\r\n\r\nWould you be willing to accept a patch that decoded the headers when writing out to disc? This would be the more debugging-friendly approach."},"comment":{"url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/comments/185140549","html_url":"https://github.com/EasyNetQ/EasyNetQ/issues/547#issuecomment-185140549","issue_url":"https://api.github.com/repos/EasyNetQ/EasyNetQ/issues/547","id":185140549,"user":{"login":"danbarua","id":469192,"avatar_url":"https://avatars.githubusercontent.com/u/469192?v=3","gravatar_id":"","url":"https://api.github.com/users/danbarua","html_url":"https://github.com/danbarua","followers_url":"https://api.github.com/users/danbarua/followers","following_url":"https://api.github.com/users/danbarua/following{/other_user}","gists_url":"https://api.github.com/users/danbarua/gists{/gist_id}","starred_url":"https://api.github.com/users/danbarua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danbarua/subscriptions","organizations_url":"https://api.github.com/users/danbarua/orgs","repos_url":"https://api.github.com/users/danbarua/repos","events_url":"https://api.github.com/users/danbarua/events{/privacy}","received_events_url":"https://api.github.com/users/danbarua/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T10:26:25Z","updated_at":"2016-02-17T10:26:25Z","body":"> the message you posted above; where did it come from? Was it a message which has been output with hosepipe and resent again?\r\n\r\nCorrect. I'm having a look through the code now, but I'm guessing the issue is that on re-publishing the base64 encoded headers are encoded once again."}}