From c8845b4bef4248fad4a9da8dad0455495b2bc6fd Mon Sep 17 00:00:00 2001
From: Flavio Percoco <flaper87@gmail.com>
Date: Mon, 15 Jun 2015 13:48:27 +0200
Subject: [PATCH] Use `inferred=True` by default

Rabbitmq's amqp1.0 plugin doesn't have support for vbin8, which is the
default encoding used by qpid-proton. In order to workaround this issue
we should use inferred=True.

Closes-bug: #1465409
Change-Id: Id265917244d7e152c5e13a10df367a3e59de8e50
---
 oslo_messaging/_drivers/protocols/amqp/driver.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/oslo_messaging/_drivers/protocols/amqp/driver.py b/oslo_messaging/_drivers/protocols/amqp/driver.py
index 705a0903c..cf1c9127b 100644
--- a/oslo_messaging/_drivers/protocols/amqp/driver.py
+++ b/oslo_messaging/_drivers/protocols/amqp/driver.py
@@ -46,7 +46,9 @@ LOG = logging.getLogger(__name__)
 
 def marshal_response(reply=None, failure=None):
     # TODO(grs): do replies have a context?
-    msg = proton.Message()
+    # NOTE(flaper87): Set inferred to True since rabbitmq-amqp-1.0 doesn't
+    # have support for vbin8.
+    msg = proton.Message(inferred=True)
     if failure:
         failure = common.serialize_remote_exception(failure)
         data = {"failure": failure}
@@ -67,7 +69,9 @@ def unmarshal_response(message, allowed):
 
 
 def marshal_request(request, context, envelope):
-    msg = proton.Message()
+    # NOTE(flaper87): Set inferred to True since rabbitmq-amqp-1.0 doesn't
+    # have support for vbin8.
+    msg = proton.Message(inferred=True)
     if envelope:
         request = common.serialize_msg(request)
     data = {