Skip to content

Commit

Permalink
Merge pull request #237 from jasonrbriggs/remove-wait-on-receipt
Browse files Browse the repository at this point in the history
remove wait on receipt
  • Loading branch information
jasonrbriggs authored Apr 13, 2019
2 parents 78c3b5e + a2414b6 commit 1b61b10
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Version 4.1.22 -
Version 4.1.22 - Apr 2019

* Infinite retry attempts (https://github.com/jasonrbriggs/stomp.py/pull/235)
* Terminate heartbeat thread on shutdown (https://github.com/jasonrbriggs/stomp.py/pull/234)
* Remove unused wait_on_receipt parameter (https://github.com/jasonrbriggs/stomp.py/pull/237)
* Reduce verbosity in logging to not include headers unless debug level is turned on (potential security issue as per: https://github.com/jasonrbriggs/stomp.py/issues/226)
* Fix for disconnect receipt usage in transport (https://github.com/jasonrbriggs/stomp.py/issues/212)
* Add __enter__/__exit__ to Connection so it can be used as a context (https://github.com/jasonrbriggs/stomp.py/issues/215)
* Additional ssl options (https://github.com/jasonrbriggs/stomp.py/pull/221/)


Version 4.1.21 -
Version 4.1.21 - July 2018

* Fix for deadlock issue (https://github.com/jasonrbriggs/stomp.py/issues/197)
* Fix for encoding issue (https://github.com/jasonrbriggs/stomp.py/issues/195)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ stomp.py has been perfunctorily tested on:

.. _JBossMessaging: http://www.jboss.org/jbossmessaging

For more info on setting up a test server (using virtualbox), contact the developer.
For more info on setting up a local test server (using docker), contact the developer.

9 changes: 3 additions & 6 deletions stomp/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def __init__(self,
ssl_cert_file=None,
ssl_ca_certs=None,
ssl_cert_validator=None,
wait_on_receipt=False,
ssl_version=DEFAULT_SSL_VERSION,
timeout=None,
keepalive=None,
Expand All @@ -112,7 +111,7 @@ def __init__(self,
transport = Transport(host_and_ports, prefer_localhost, try_loopback_connect,
reconnect_sleep_initial, reconnect_sleep_increase, reconnect_sleep_jitter,
reconnect_sleep_max, reconnect_attempts_max, use_ssl, ssl_key_file, ssl_cert_file,
ssl_ca_certs, ssl_cert_validator, wait_on_receipt, ssl_version, timeout,
ssl_ca_certs, ssl_cert_validator, ssl_version, timeout,
keepalive, None, auto_decode, encoding)
BaseConnection.__init__(self, transport)
Protocol10.__init__(self, transport, auto_content_length)
Expand Down Expand Up @@ -152,7 +151,6 @@ def __init__(self,
ssl_cert_file=None,
ssl_ca_certs=None,
ssl_cert_validator=None,
wait_on_receipt=False,
ssl_version=DEFAULT_SSL_VERSION,
timeout=None,
heartbeats=(0, 0),
Expand All @@ -166,7 +164,7 @@ def __init__(self,
transport = Transport(host_and_ports, prefer_localhost, try_loopback_connect,
reconnect_sleep_initial, reconnect_sleep_increase, reconnect_sleep_jitter,
reconnect_sleep_max, reconnect_attempts_max, use_ssl, ssl_key_file, ssl_cert_file,
ssl_ca_certs, ssl_cert_validator, wait_on_receipt, ssl_version, timeout,
ssl_ca_certs, ssl_cert_validator, ssl_version, timeout,
keepalive, vhost, auto_decode, encoding)
BaseConnection.__init__(self, transport)
Protocol11.__init__(self, transport, heartbeats, auto_content_length, heart_beat_receive_scale=heart_beat_receive_scale)
Expand Down Expand Up @@ -206,7 +204,6 @@ def __init__(self,
ssl_cert_file=None,
ssl_ca_certs=None,
ssl_cert_validator=None,
wait_on_receipt=False,
ssl_version=DEFAULT_SSL_VERSION,
timeout=None,
heartbeats=(0, 0),
Expand All @@ -220,7 +217,7 @@ def __init__(self,
transport = Transport(host_and_ports, prefer_localhost, try_loopback_connect,
reconnect_sleep_initial, reconnect_sleep_increase, reconnect_sleep_jitter,
reconnect_sleep_max, reconnect_attempts_max, use_ssl, ssl_key_file, ssl_cert_file,
ssl_ca_certs, ssl_cert_validator, wait_on_receipt, ssl_version, timeout,
ssl_ca_certs, ssl_cert_validator, ssl_version, timeout,
keepalive, vhost, auto_decode, encoding)
BaseConnection.__init__(self, transport)
Protocol12.__init__(self, transport, heartbeats, auto_content_length, heart_beat_receive_scale=heart_beat_receive_scale)
Expand Down
8 changes: 2 additions & 6 deletions stomp/test/apollo_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

import stomp
from stomp.listener import TestListener
from stomp.listener import WaitingListener
from stomp.test.testutils import *


Expand All @@ -12,7 +12,7 @@ def setUp(self):

def testbasic(self):
conn = stomp.Connection11(get_apollo_host())
listener = TestListener('123')
listener = WaitingListener('123')
conn.set_listener('', listener)
conn.connect(get_default_user(), get_default_password(), wait=True)
conn.subscribe(destination='/queue/test', id=1, ack='auto')
Expand All @@ -22,7 +22,3 @@ def testbasic(self):
listener.wait_on_receipt()

conn.disconnect(receipt=None)

self.assertTrue(listener.connections == 1, 'should have received 1 connection acknowledgement')
self.assertTrue(listener.messages == 1, 'should have received 1 message')
self.assertTrue(listener.errors == 0, 'should not have received any errors')
5 changes: 1 addition & 4 deletions stomp/test/multicast_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,4 @@ def test_send_nonascii_auto_encoding(self):

(_, msg) = self.listener.get_latest_message()

if sys.hexversion >= 0x03000000:
self.assertEqual(txt, msg)
else:
self.assertEqual(txt.encode('utf-8'), msg)
self.assertEqual(txt.encode('utf-8'), msg)
7 changes: 2 additions & 5 deletions stomp/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class BaseTransport(stomp.listener.Publisher):
and anything else outside of actually establishing a network connection, sending and
receiving of messages (so generally socket-agnostic functions).
:param bool wait_on_receipt: deprecated, ignored
:param bool auto_decode: automatically decode message responses as strings, rather than
leaving them as bytes. This preserves the behaviour as of version 4.0.16.
(To be defaulted to False as of the next release)
Expand All @@ -63,7 +62,7 @@ class BaseTransport(stomp.listener.Publisher):
#
__content_length_re = re.compile(b'^content-length[:]\\s*(?P<value>[0-9]+)', re.MULTILINE)

def __init__(self, wait_on_receipt=False, auto_decode=True, encoding='utf-8'):
def __init__(self, auto_decode=True, encoding='utf-8'):
self.__recvbuf = b''
self.listeners = {}
self.running = False
Expand Down Expand Up @@ -483,7 +482,6 @@ class Transport(BaseTransport):
:param ssl_cert_validator: deprecated, see :py:meth:`set_ssl`
:param ssl_version: deprecated, see :py:meth:`set_ssl`
:param timeout: the timeout value to use when connecting the stomp socket
:param bool wait_on_receipt: deprecated, ignored
:param keepalive: some operating systems support sending the occasional heart
beat packets to detect when a connection fails. This
parameter can either be set set to a boolean to turn on the
Expand All @@ -508,7 +506,6 @@ def __init__(self,
ssl_cert_file=None,
ssl_ca_certs=None,
ssl_cert_validator=None,
wait_on_receipt=False,
ssl_version=None,
timeout=None,
keepalive=None,
Expand All @@ -517,7 +514,7 @@ def __init__(self,
encoding='utf-8',
recv_bytes=1024
):
BaseTransport.__init__(self, wait_on_receipt, auto_decode, encoding)
BaseTransport.__init__(self, auto_decode, encoding)

if host_and_ports is None:
host_and_ports = [('localhost', 61613)]
Expand Down

0 comments on commit 1b61b10

Please sign in to comment.