Skip to content

Instantly share code, notes, and snippets.

@slacy
Created May 22, 2012 18:29
Show Gist options
  • Save slacy/2770786 to your computer and use it in GitHub Desktop.
Save slacy/2770786 to your computer and use it in GitHub Desktop.
Kombu vs. boto
import boto
from kombu import BrokerConnection, Queue
def main():
queue = Queue("steve-test-kombu")
with BrokerConnection('sqs://<KEY_ID>@<ACCESS_KEY>:80/') as connection:
connection.connect()
queue(connection.channel()).declare()
with connection.Producer(serializer="raw") as producer:
producer.publish('hello world')
def boto_main():
boto_conn = boto.connect_sqs()
queue = boto_conn.get_queue('steve-test-kombu')
msg = queue.new_message(body='hello world')
queue.write(msg)
boto_conn.close()
if __name__ == '__main__':
main()
boto_main()
@slacy
Copy link
Author

slacy commented May 22, 2012

Ideally, I'd like main() and boto_main() to produce the exact same message into the queue, but this isn't currently happening. The one from kombu is significantly longer, even though I'm using the 'raw' encoding and no compression...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment