Anyone got this working with Celery?

858 views
Skip to first unread message

Aru Sahni

unread,
Sep 6, 2015, 10:17:34 PM9/6/15
to ElasticMQ

Hi all,

I'm trying to use ElasticMQ as a local-development alternative for SQS.  However, I'm having trouble dropping it in place of SQS with my Celery setup.  Right now, I'm trying the following:

settings.py
region = boto.sqs.regioninfo.RegionInfo(name='elasticmq', endpoint="127.0.0.1")
BROKER_URL
= "sqs://x:x@"
BROKER_TRANSPORT_OPTIONS
= {'regioninfo': region, 'port': 9324}


app.py
app = Celery('test_proj', include=['workflow.processor', 'workflow.writer'])
app
.config_from_object('celeryconfig')
app
.conf.update(BROKER_URL=settings.BROKER_URL)
app
.conf.update(BROKER_TRANSPORT_OPTIONS=settings.BROKER_TRANSPORT_OPTIONS)

# Optional configuration, see the application user guide.
app
.conf.update(
    CELERY_TASK_RESULT_EXPIRES
=3600,
)

if __name__ == '__main__':
    app
.start()


Attempting to run this results in various connection errors.  Celery displays the transport as being: "transport:   sqs://x:**@localhost//", but things appear to be trying to hit AWS:

[2015-09-07 02:08:08,902: DEBUG/MainProcess] Final headers: {'Host': 'queue.amazonaws.com', 'User-Agent': 'Boto/2.38.0 Python/3.4.0 Linux/3.13.0-55-generic', 'Authorization': 'AWS4-HMAC-SHA256 Credential=x/20150907/us-east-1/sqs/aws4_request,SignedHeaders=host;x-amz-date,Signature=<snip>', 'X-Amz-Date': '20150907T020808Z', 'Content-Length': '0'}
[2015-09-07 02:08:08,974: DEBUG/MainProcess] wrapping ssl socket; CA certificate file=/opt/app-venv/lib/python3.4/site-packages/boto/cacerts/cacerts.txt
[2015-09-07 02:08:09,036: DEBUG/MainProcess] validating server certificate: hostname=queue.amazonaws.com, certificate hosts=['sqs.us-east-1.amazonaws.com', 'queue.amazonaws.com']
[2015-09-07 02:08:09,105: DEBUG/MainProcess] Response headers: [('Server', 'Server'), ('Date', 'Mon, 07 Sep 2015 02:08:09 GMT'), ('Content-Type', 'text/xml'), ('Content-Length', '311'), ('Connection', 'keep-alive'), ('x-amzn-RequestId', '5c83024a-4e21-5a2c-8307-4c2cbde88d6b')]
[2015-09-07 02:08:09,106: DEBUG/MainProcess] b'<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>The security token included in the request is invalid.</Message><Detail/></Error><RequestId>5c83024a-4e21-5a2c-8307-4c2cbde88d6b</RequestId></ErrorResponse>'
[2015-09-07 02:08:09,106: ERROR/MainProcess] 403 Forbidden
[2015-09-07 02:08:09,106: ERROR/MainProcess] b'<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>The security token included in the request is invalid.</Message><Detail/></Error><RequestId>5c83024a-4e21-5a2c-8307-4c2cbde88d6b</RequestId></ErrorResponse>'
[2015-09-07 02:08:09,109: ERROR/MainProcess] consumer: Cannot connect to sqs://x:**@localhost//: SQSError: 403 Forbidden
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>InvalidClientTokenId</Code><Message>The security token included in the request is invalid.</Message><Detail/></Error><RequestId>5c83024a-4e21-5a2c-8307-4c2cbde88d6b</RequestId></ErrorResponse>.
Trying again in 2.00 seconds...

I'm able to run the sample boto example in the ElasticMQ docs, including invoking list queues endpoint.

Any pointers would be appreciated!

Regards,
~Aru

Kartik Verma

unread,
Dec 24, 2018, 6:54:54 AM12/24/18
to ElasticMQ
Hi,
I am facing same issue.
Did you solve it?

Aru Sahni

unread,
Dec 24, 2018, 8:46:05 AM12/24/18
to elas...@googlegroups.com
No. I ended up using RabbitMQ.

Regards,
~Aru

--

---
You received this message because you are subscribed to a topic in the Google Groups "ElasticMQ" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticmq/Ddgl9sGxqig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elasticmq+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kartik Verma

unread,
Dec 24, 2018, 8:52:32 AM12/24/18
to elas...@googlegroups.com
For Local Development or for Production as well?

You received this message because you are subscribed to the Google Groups "ElasticMQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticmq+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages