From f181e44554dd66325479f121c3cb9288c773106c Mon Sep 17 00:00:00 2001 From: Gentle Yang Date: Thu, 27 Aug 2015 18:15:07 +0800 Subject: [PATCH 1/5] add new send method send_noreceipt() --- stompy/stomp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stompy/stomp.py b/stompy/stomp.py index ad2ecc7..2f98e81 100644 --- a/stompy/stomp.py +++ b/stompy/stomp.py @@ -84,10 +84,18 @@ def send(self, conf=None): ... 'persistent': 'true'}) """ + self._send(conf,True) + + def send_noreceipt(self,conf=None): + """Send message to STOMP server without receipt + """ + self._send(conf,False) + + def _send(self,conf=None,receipt) headers = dict(conf) body = headers.pop("body", "") return self._send_command("SEND", headers, extra={"body": body}, - want_receipt=True) + want_receipt=reveipt) def _build_frame(self, *args, **kwargs): self._connected_or_raise() From 4bb8aac1caae45b4584e376e5ad256e4113830d5 Mon Sep 17 00:00:00 2001 From: Gentle Yang Date: Thu, 27 Aug 2015 18:20:16 +0800 Subject: [PATCH 2/5] update send() function for adding want_receipt --- stompy/stomp.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/stompy/stomp.py b/stompy/stomp.py index 2f98e81..b6faa87 100644 --- a/stompy/stomp.py +++ b/stompy/stomp.py @@ -68,7 +68,7 @@ def disconnect(self, conf=None): pass self.connected = False - def send(self, conf=None): + def send(self, conf=None, receipt=True): """Send message to STOMP server You'll need to pass the body and any other headers your @@ -84,18 +84,10 @@ def send(self, conf=None): ... 'persistent': 'true'}) """ - self._send(conf,True) - - def send_noreceipt(self,conf=None): - """Send message to STOMP server without receipt - """ - self._send(conf,False) - - def _send(self,conf=None,receipt) headers = dict(conf) body = headers.pop("body", "") return self._send_command("SEND", headers, extra={"body": body}, - want_receipt=reveipt) + want_receipt=receipt) def _build_frame(self, *args, **kwargs): self._connected_or_raise() From 6f5235c0d2d8edc97d630066dae195907845ccbb Mon Sep 17 00:00:00 2001 From: Gentle Yang Date: Thu, 27 Aug 2015 18:21:27 +0800 Subject: [PATCH 3/5] add receipt parameter --- stompy/simple.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stompy/simple.py b/stompy/simple.py index cb5eaef..5342421 100644 --- a/stompy/simple.py +++ b/stompy/simple.py @@ -63,7 +63,7 @@ def get_nowait(self): """ return self.get(block=False) - def put(self, item, destination, persistent=True, conf=None): + def put(self, item, destination, persistent=True, conf=None,receipt=True): """Put an item into the queue. :param item: Body of the message. @@ -78,7 +78,7 @@ def put(self, item, destination, persistent=True, conf=None): conf = self._make_conf(conf, body=item, destination=destination, persistent=persistent) - return self.stomp.send(conf) + return self.stomp.send(conf,receipt) def connect(self, username=None, password=None, clientid=None): """Connect to the broker. From 7c556c0c15aa8da51e10a953a1d63810edb0c09f Mon Sep 17 00:00:00 2001 From: Gentle Yang Date: Tue, 15 Dec 2015 16:41:55 +0800 Subject: [PATCH 4/5] update version no to v0.2.10 --- stompy/distmeta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stompy/distmeta.py b/stompy/distmeta.py index cdbf878..35a0cf8 100644 --- a/stompy/distmeta.py +++ b/stompy/distmeta.py @@ -1,6 +1,6 @@ """Implementation of the STOMP protocol in Python. """ -VERSION = (0, 2, 9) +VERSION = (0, 2, 10) __version__ = ".".join(map(str, VERSION)) __author__ = "Benjamin W. Smith" __contact__ = "benjaminwarfield@just-another.net" From be3cf4d95e31b3e7f35e437df78b57cd29283256 Mon Sep 17 00:00:00 2001 From: Gentle Yang Date: Fri, 15 Jan 2016 08:35:39 +0800 Subject: [PATCH 5/5] Update TODO --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 3dbb4e2..bf5b03b 100644 --- a/TODO +++ b/TODO @@ -1 +1,3 @@ * Be more awesome + +* Support auto reconnect