Home > other >  Stomp error AttributeError: 'StompConnection10' object has no attribute 'start'
Stomp error AttributeError: 'StompConnection10' object has no attribute 'start'

Time:09-23

If __name__=="__main__ ':
Conn=stomp. Connection10 ([(__host __port)])
Conn. Start ()
Conn. Connect (the __user __password, wait=True)
For I in range (10) :
Send_to_topic (1, '1 topic1: testing information... ')
Send_to_topic (2, '2 topic2: testing information... ')
Time. Sleep (5)
Conn. Disconnect ()
conn. # start () this method error

Stomp error AttributeError: 'StompConnection10' object has no attribute 'start'

CodePudding user response:

Environment: Windows 7 x64 python3.7.2 32 bit code completion does not start method, but all the sample code on the net, so change to the win10 reported the same mistake, which the great spirit to guide the

CodePudding user response:

Comment out the conn. Start (), the new version does not need

Citing official example:
The import stomp

Conn=stomp. Connection ()
Conn. Connect (' admin 'and' password 'wait=True)
Conn. Send (body="'. Join (sys. Argv [1]), destination='/queue/test')
Conn. Disconnect ()
  • Related