Skip to content

amqp_channel is null when invoked inside send_amqp_msg function #1

Description

@mbrudnoy

After using the keywords 'init amqp connection' and 'set amqp destination' correctly, the keyword 'send amqp message' fails with the following error:

AttributeError: 'NoneType' object has no attribute 'basic_publish'.

Running with DEBUG log level, I can see the following Trace as well.

Traceback (most recent call last):
File "/Users/mbrudnoy/Projects/PythonVirtualEnvs/robot/lib/python2.7/site-packages/AMQPLib/AMQPMsg.py", line 92, in send_amqp_msg
self.amqp_channel.basic_publish(exchange=amqp_exchange,

After playing around with the code, I noticed that even though amqp_channel is set in the init_amqp_connection function, it appears to lose the reference later on.

The function send_amqp_message works if I replace self.amqp_channel.basic_publish(...) with self.amqp_connection.channel().basic_pubish(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions