[ 
https://issues.apache.org/jira/browse/AMBARI-26099?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shuaipeng Lee updated AMBARI-26099:
-----------------------------------
    Description: 
When using ambari_stomp module to send or recieve message, there will be an 
error

 
{code:java}
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' {code}
here is my test case.(Before testing, please download the testcase.zip)

 
1) Add ambari-common to PYTHONPATH
{code:java}
export PYTHONPATH=$PYTHONPATH:${your_ambari_common_home}/src/main/python {code}
2) Start local stompserver
{code:java}
bash run.sh  {code}
3) Test it
{code:java}
python3 python/demo1.py test {code}

  was:
When using ambari_stomp module to send or recieve message, there will be an 
error

 
{code:java}
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' {code}
here is my test case.(Before testing, please download the testcase.zip)

 
1) Add ambari-common to PYTHONPATH
{code:java}
export PYTHONPATH=$PYTHONPATH:${your_ambari_common_home}/src/main/python {code}
2) Start local stompserver
{code:java}
bash run.sh  {code}
3) Test it
{code:java}
// code placeholder
{code}


> Ambari Common Stomp Module AttributeError
> -----------------------------------------
>
>                 Key: AMBARI-26099
>                 URL: https://issues.apache.org/jira/browse/AMBARI-26099
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-trunk
>            Reporter: Shuaipeng Lee
>            Priority: Major
>         Attachments: testcase.zip
>
>
> When using ambari_stomp module to send or recieve message, there will be an 
> error
>  
> {code:java}
> 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' {code}
> here is my test case.(Before testing, please download the testcase.zip)
>  
> 1) Add ambari-common to PYTHONPATH
> {code:java}
> export PYTHONPATH=$PYTHONPATH:${your_ambari_common_home}/src/main/python 
> {code}
> 2) Start local stompserver
> {code:java}
> bash run.sh  {code}
> 3) Test it
> {code:java}
> python3 python/demo1.py test {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to