Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b2c6a12

Browse files
committed
Release of version 1.4.8
1 parent 9025840 commit b2c6a12

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

AWSIoTPythonSDK/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "1.4.7"
1+
__version__ = "1.4.8"
22

33

AWSIoTPythonSDK/core/protocol/internal/workers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ def _handle_resubscribe(self):
187187
if subscriptions and not self._has_user_disconnect_request():
188188
self._logger.debug("Start resubscribing")
189189
self._client_status.set_status(ClientStatus.RESUBSCRIBE)
190-
for topic, (qos, message_callback) in subscriptions:
190+
for topic, (qos, message_callback, ack_callback) in subscriptions:
191191
if self._has_user_disconnect_request():
192192
self._logger.debug("User disconnect detected")
193193
break
194-
self._internal_async_client.subscribe(topic, qos)
194+
self._internal_async_client.subscribe(topic, qos, ack_callback)
195195

196196
def _handle_draining(self):
197197
if self._offline_requests_manager.has_more() and not self._has_user_disconnect_request():
@@ -232,7 +232,7 @@ def _dispatch_message(self, mid, message):
232232
self._logger.debug("Dispatching [message] event")
233233
subscriptions = self._subscription_manager.list_records()
234234
if subscriptions:
235-
for topic, (qos, message_callback) in subscriptions:
235+
for topic, (qos, message_callback, _) in subscriptions:
236236
if topic_matches_sub(topic, message.topic) and message_callback:
237237
message_callback(None, None, message) # message_callback(client, userdata, message)
238238

@@ -243,7 +243,7 @@ def _handle_offline_publish(self, request):
243243

244244
def _handle_offline_subscribe(self, request):
245245
topic, qos, message_callback, ack_callback = request.data
246-
self._subscription_manager.add_record(topic, qos, message_callback)
246+
self._subscription_manager.add_record(topic, qos, message_callback, ack_callback)
247247
self._internal_async_client.subscribe(topic, qos, ack_callback)
248248
self._logger.debug("Processed offline subscribe request")
249249

@@ -261,9 +261,9 @@ class SubscriptionManager(object):
261261
def __init__(self):
262262
self._subscription_map = dict()
263263

264-
def add_record(self, topic, qos, message_callback):
264+
def add_record(self, topic, qos, message_callback, ack_callback):
265265
self._logger.debug("Adding a new subscription record: %s qos: %d", topic, qos)
266-
self._subscription_map[topic] = qos, message_callback # message_callback could be None
266+
self._subscription_map[topic] = qos, message_callback, ack_callback # message_callback and/or ack_callback could be None
267267

268268
def remove_record(self, topic):
269269
self._logger.debug("Removing subscription record: %s", topic)

AWSIoTPythonSDK/core/protocol/mqtt_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def subscribe(self, topic, qos, message_callback=None):
296296
self._logger.info("Performing sync subscribe...")
297297
ret = False
298298
if ClientStatus.STABLE != self._client_status.get_status():
299-
self._handle_offline_request(RequestTypes.SUBSCRIBE, (topic, qos, message_callback))
299+
self._handle_offline_request(RequestTypes.SUBSCRIBE, (topic, qos, message_callback, None))
300300
else:
301301
event = Event()
302302
rc, mid = self._subscribe_async(topic, qos, self._create_blocking_ack_callback(event), message_callback)
@@ -317,7 +317,7 @@ def subscribe_async(self, topic, qos, ack_callback=None, message_callback=None):
317317
return mid
318318

319319
def _subscribe_async(self, topic, qos, ack_callback=None, message_callback=None):
320-
self._subscription_manager.add_record(topic, qos, message_callback)
320+
self._subscription_manager.add_record(topic, qos, message_callback, ack_callback)
321321
rc, mid = self._internal_async_client.subscribe(topic, qos, ack_callback)
322322
if MQTT_ERR_SUCCESS != rc:
323323
self._logger.error("Subscribe error: %d", rc)
@@ -328,7 +328,7 @@ def unsubscribe(self, topic):
328328
self._logger.info("Performing sync unsubscribe...")
329329
ret = False
330330
if ClientStatus.STABLE != self._client_status.get_status():
331-
self._handle_offline_request(RequestTypes.UNSUBSCRIBE, (topic))
331+
self._handle_offline_request(RequestTypes.UNSUBSCRIBE, (topic, None))
332332
else:
333333
event = Event()
334334
rc, mid = self._unsubscribe_async(topic, self._create_blocking_ack_callback(event))

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
CHANGELOG
33
=========
44

5+
1.4.8
6+
=====
7+
* improvement: Added support for subscription acknowledgement callbacks while offline or resubscribing
8+
59
1.4.7
610
=====
711
* improvement: Added connection establishment control through client socket factory option

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ types:
142142
For the certificate-based mutual authentication connection
143143
type.
144144
Download the `AWS IoT root
145-
CA <https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem>`__.
145+
CA <https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication>`__.
146146
Use the AWS IoT console to create and download the certificate and private key. You must specify the location of these files
147147
when you initialize the client.
148148

@@ -151,8 +151,8 @@ types:
151151
For the Websocket with Signature Version 4 authentication type. You will need IAM credentials: an access key ID, a secret access
152152
key, and an optional session token. You must also
153153
download the `AWS IoT root
154-
CA <https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem>`__.
155-
You can specify the IAM credentails by:
154+
CA <https://docs.aws.amazon.com/iot/latest/developerguide/managing-device-certs.html#server-authentication>`__.
155+
You can specify the IAM credentials by:
156156

157157
- Passing method parameters
158158

0 commit comments

Comments
 (0)