Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-8437

Python: Sends garbage binary text at start of messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.30
    • None
    • None

    Description

      I am using `python-qpid-proton` pip package on python 3 to send messages to an ActiveMQ instance, when sends it shows some garbage binary text at start, like a header.

      Code:

      def on_sendable(self, event):
          if event.sender.credit and not self.sent:
              self.sent = True
      
              message = Message(
                  id=int(self.external_send.voucher.id),
                  inferred=False,
                  body=json.dumps(OrderedDict((
                      ("kind", kind_to_str(self.kind)),
                      ("first_name", self.external_send.voucher.first_name),
                      ("last_name", self.external_send.voucher.last_name),
                      ("phone_number", self.external_send.voucher.phone_number),
                      ("email", self.external_send.voucher.email),
                      ("address", self.external_send.voucher.address),
                      ("extra_address", self.external_send.voucher.extra_address),
                      ("city", self.external_send.voucher.city),
                  )))
              )
      
              message.content_type = 'text/plain; charset="utf-8"'
      
              event.sender.send(message)
      

      And in ActiveMQ shows the following:

      SpESs�
      �4�Sw�v{"kind": "delivery", "first_name": .... json continues
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            fbuccioni Felipe Buccioni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: