Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When using ambari_stomp module to send or recieve message, there will be an error
Exception in thread StompReceiverThread-1: Traceback (most recent call last): File "/home/peng/Desktop/202309/pythonlab/python3819/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/home/peng/Desktop/202309/pythonlab/python3819/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/peng/Desktop/projects/ambari/ambari-common/src/main/python/ambari_stomp/transport.py", line 334, in __receiver_loop frames = self.__read() File "/home/peng/Desktop/projects/ambari/ambari-common/src/main/python/ambari_stomp/transport.py", line 380, in __read if c.encode() == b'\x0a' and not self.__recvbuf and not fastbuf.tell(): AttributeError: 'bytes' object has no attribute 'encode'
here is my test case.(Before testing, please download the testcase.zip)
1) Add ambari-common to PYTHONPATH
export PYTHONPATH=$PYTHONPATH:${your_ambari_common_home}/src/main/python
2) Start local stompserver
bash run.sh
3) Test it
python3 python/demo1.py test
Attachments
Attachments
Issue Links
- links to