HISTORY notes for AMPS Python Client
This page provides a list of changes made in each version of AMPS Python Client.
Python version 5.3
Version 5.3.5.0 (2025-08-04)
Breaking changes:
Client.setDisconnectHandler
has been marked as deprecated. Automatic failover should be handled using anHAClient
. Monitoring the connection state should be done with aConnectionStateListener
. This change means that the client now enforces the long-standing best practice that applications should not replace the disconnect handler. (AC-1276)- Calling
setDisconnectHandler
on anHAClient
will throw aUsageException
as this would disable the automatic failover behavior. This change means that the client now enforces the long-standing best practice that applications should not replace the disconnect handler. (AC-1276)
New features:
- The new
bookmark_not_found
option available in AMPS server 5.3.5.0 and above is now supported in theMessage.Options
class. (AC-1338)
Fixes and other changes:
- Passing
AMPS_DEFAULT_TOP_N
toCommand.setTopN
will now correctly unset any topN value and not send a very large number. (z13291) (AC-1129) - A
ConflatingRecoveryPointAdapter
constructed with aSOWRecoveryPointAdapter
will now properly increment the reference count on theSOWRecoveryPointAdapter
. Previously, theSOWRecoveryPointAdapter
could get garbage collected by the Python interpreter leading to a core dump during the next update. (AC-1290) - A
SOWRecoveryPointAdapter
created with a client that hasn't been connected will no longer throw an exception during stack unwind caused by throwing an exception when used to initialize aBookmarkStore
. (z18948) (AC-1355) - A newly constructed
MemoryPublishStore
will now always start sequencing at a manufactured value rather than a value based on what the AMPS server acknowledges during logon. This prevents incorrectly treating messages as duplicates in the case where a client has previously published more messages than the AMPS server can acknowledge during logon. (AC-1358) - A timeout set on calls to
sowDelete
,sowDeleteByKeys
, orsowDeleteByData
functions that return aMessage
now applies to both the time it takes to get a processed ack from the server and the time the server takes after the processed ack to return the stats ack. (AC-1371) - Changed tcps code to use poll instead of select to avoid
FD_SETSIZE
limit on fd. (z19441) (AC-1373) - Prevent a deadlock that could occur from an immediate call to
connect
on aClient
following an exception from callinglogon
. (AC-1376)
Version 5.3.4.5 (2025-01-15)
New features:
- Added
http_preflight
URI parameter to help route connections to AMPS through proxy servers by starting the connection with an HTTP GET upgrade request. Using this feature requires using theamps
protocol and AMPS server version 5.3.4.0 or higher. Extra headers may be set on the GET message usingadd_http_preflight_header
oradd_http_preflight_header_key_value
multiple times. (AC-1284)
Fixes and other changes:
- When executing a
Command
forunsubscribe
, the client will now correctly remove any message handlers for the subscription and update theSubscriptionManager
to not restart the subscription. (z18760) (AC-1349) - Failures when creating a
tcps
connection using Python3 are now correctly passed along in theAMPSException
. (z18174) (AC-1347)
Version 5.3.4.4 (2024-12-18)
New features:
MemoryPublishStore
,PublishStore
, andHybridPublishStore
now have all of the functions found in other languages. New methods arestore(Message)
,discardUpTo(Int)
,replay(MessageHandler)
,replaySingle(MessagHandler, Int)
,getLastPersisted()
, andgetLowestUnpersisted()
. (z18686) (AC-375)- For Python 3.X,
AMPS.ssl_init()
has keyword arguments: dllpath, ssl_context, and strict_ciphers_only. The first arg has always been there. The ssl_context can be anssl.SSLContext
that has already been set up in your Python code. The boolstrict_ciphers_only
will set Python 3.10+ to useDEFAULT
ciphers ifFalse
. (z18174) (AC-1322) AMPS.ssl_get_context()
can be called afterAMPS.ssl_init()
to get the underlyingssl.SSLContext
. (z18174) (AC-1322)AMPS.Client
now has a methodget_ssl()
that returns thessl.SSLSocket
of a connected client using tcps. (z18174) (AC-1322)
Fixes and other changes:
- Client source code should now work with versions up to Python 3.13. (AC-1324)
- Updated HAClient reconnect logic to ensure that a disconnect immediately after successful logon completion can't be missed and leave a client in a disconnected state. Also, added extra protection to keep only a single thread handling reconnect. (AC-1327)
- Allow
DisconnectedException
to be thrown byexecute
for publish and delta_publish commands. (AC-1328) - Fixed logic for functions that send a command and don't return until after
a processed ack has returned from the server to guarantee that they don't
report a
DisconnectedException
if the disconnect happens before the command has been sent. This can result in seeing aSubidInUseException
if the same command is tried again after theDisconnectedException
. (z18574) (AC-1329) - Fixed logic for functions that return
MessageStream
objects so they aren't closed if the disconnect occurs before the command is sent. (AC-1331) - Fixed logic for commands waiting for a processed ack from the server to
ensure that a disconnect only results in
DisconnectedException
and not aTimedOutException
. (AC-1337) - The
amps
protocol parser now correctly parses and serializes headers containing characters that must be escaped in JSON. (AC-1342) SOWRecoveryPointAdapter
properly obeys theupdateFailureThrows_
flag to throw exceptions in all cases where there is one. (z18648) (AC-1343)- BookmarkStore implementations will no longer allow an invalid
bookmark used when placing a bookmark subscription to be saved in the store
or used when creating the most recent bookmark. Previously, this could lead
to always getting an
InvalidBookmarkException
or in some cases, a core dump while building the most recent bookmark. (z18574) (AC-1345)
Version 5.3.4.3 (2024-08-27)
Fixes and other changes:
- Ensured behavior of an exception in
ServerChooser.reportSuccess
is to callServerChooser.reportFailure
with the exception thrown. (z17400) (AC-1312) - Further work ensuring all client receive threads are properly joined or detached, fixing some code paths that were missed in AC-1300. Other cleanup related to valgrind warnings of memory still accessible at application shutdown. (z17180) (AC-1313)
- Don't request the completed ack automatically for
sow_and_subscribe
orsow_and_delta_subscribe
commands. (z18075) (AC-1314) - Always use synchronous send with processed ack when executing
Command
for commands that return data. (z18075) (AC-1315)
Version 5.3.4.2 (2024-07-15)
Fixes and other changes:
- Ensure that all client receive threads are properly joined or detached after a disconnect to prevent memory growth. (z17180) (AC-1300)
- Prevent an exeption that previously occured from: setting a transport
filter on a client, setting the transport filter back to
None
, then setting a new transport filter on the client. (z16734) (AC-1279) - All subscribe and sow commands now send an
unsubscribe
if they timeout waiting for a processed ack. This avoids having results sent to client later, when the command completes. (AC-1281) - Client will no longer automatically request a processed ack on commands
that don't return data when used with
execute
. (z16384) (AC-1283) - A
UsageException
will be thrown from aSOWRecoverPointAdapter
if the client passed as the adapter client has the same name as the client it's tracking. (AC-1285) - Fix possible deadlock when using a
ConflatingRecoveryPointAdapter
with aDynamicRecoveryPoint
that could occur if the bookmark store attempted to update the adapter while it was doing a conflation update. (AC-1288) - Fix escaping of options and orderby fields when using the amps protocol to connect. (AC-1292)
- Fix
MessageStream
timeout behavior to match the set timeout rather than be 1 second. (z17169) (AC-1296) - Correctly handle timeouts on tcps socket reads to run idle actions like sending batched queue acks and checking for heartbeats. (z17218) (AC-1303)
- Continue to attempt to send heartbeats on every beat interval rather than simply waiting for read timeout to be exceeded. This may catch disconnects sooner in cases where the server didn't properly close the connection, such as a cloud host shutting down. (AC-1305)
- The per thread
Message
used for messages going into aStore
is now cleaned up as each thread exits, rather than all at exit. (AC-1306) - Ensure that tcps clients handle send failures caused by push back on the socket and properly retry. (AC-1307)
- Prevent rare deadlock during shutdown caused by calling Python library functions during interpreter finalization. (AC-1311)
Version 5.3.4.1 (2023-12-27)
New features:
- AMPS Python Client is now available on pypi.org and can be installed easily
using
pip3 install amps-python-client
. You can view the repository at https://pypi.org/project/amps-python-client/. (AC-1265)
Version 5.3.4.0 (2023-10-09)
New features:
- AMPS Python Client now defaults to enabling tcp_keepalive on connections to
the AMPS server, consistent with other client languages. Previous behavior
can be obtained by adding
tcp_keepalive=false
to the connect string options. (AC-1256) - AMPS Python Client now supports MacOS on arm64 and x86_64. (AC-1200)
- AMPS Python Client now supports Linux on arm64.
- Added a way for clients to be notified and take action when a subscription
fails after a fail-over event. The
HAClient
now has aset_failed_resubscribe_handler
which takes a callable handling the subscribe message, the requested ack types, and the exception thrown when trying to send the command. The handler should return True to remove the subscription from the client and False to force the client to retry it, including doing a reconnect. (AC-1096) (z12909) - Added an optional argument to
Client.set_transport_filter
to specify if the transport filter might be used to modify the bytes, such as for testing bad data. (AC-1170) - Added
setErrorOnPublishGap
to theStore
interface and toClient
. If this is set, aStore
implementation will throw an exception if a server attempts to acknowledge a sequence number for a message that is already discarded. This can be useful to keep a client from failing over to a server that was not usingsync
acknowledgement to the server the client was previously connected to until all messages the client published have arrived at the new server. (AC-1202) (z13761) - Allow setting a TLS server name indication (SNI) via a connection parameter. (AC-1235)
- Added
get_name_hash_value
toClient
to return the client's hash id as a number as opposed to the string returned fromget_name_hash
. (AC-1169)
Fixes and other changes:
- Ack timeout can't be set to 0 if ack batch size > 1. (AC-1206)
- Fork handling was added to prevent a child process from starting with a mutex already locked. (AC-1225)
- Fixed a deadlock in tcps involving 3 threads that could occur when one thread is trying to close the connection during a reconnect event in the receive thread. (AC-1238)
- Cleaned up some compiler warnings using c++14, c++17, and c++20 as the chosen standard. (AC-1239)
- Fixed issue with connecting to a server on loopback when there is no outside network connection such as when in airplane mode. (AC-1249)
- Prevent receive thread from possibly running beyond the lifetime of its Client, possibly causing segv or unexpected behaviors. (AC-1250)
- Fix
sow_and_delta_subscribe
convenience function to not send the command twice. (AC-1259) (z16250) - Fix a memory leak of a
struct addrinfo
when trying to bind the client connection to local address fails. (AC-1260) - Correct all of
Message.Command.xxxEnum
values. (AC-1261) - Prevent any commands from being sent to the server while waiting for the logon ack and ensure no duplication with commands that are part of the overall logon process such as heartbeat commands. (AC-1262)
Version 5.3.3.5 (2023-05-23)
Fixes and other changes:
- Prevent possible crash during interpreter shutdown while clients are still connected and possibly receiving messages. (AC-1195)
- Client no longer tries to send an
unsubscribe
command as part of disconnect. (AC-1199) - Prevent possible crash during changes to the exception listener, including during shutdown, caused by either not having the GIL or trying to access the GIL during interpreter shutdown. (AC-1210)
- Prevent possible crash during disconnect handling where a race condition
could cause a NULL pointer to be sent to a handler instead of a pointer
to the
Client
. (AC-1211) - Change field escaping to include command id and query id but not the correlation id which must be base64 characters. (AC-1215)
- Optimize logon and flush commands to not use Nagle to avoid a delay in send. (AC-1231)
- Prevent possible crash if a thread is canceled while attempting to check if the interpreter has been signaled to shutdown. (AC-1236)
Version 5.3.3.4 (2023-01-11)
Fixes and other changes:
- Client can now be built with all functions exported on Windows by defining AMPS_SHARED before building. (AC-1204)
- Removed all calls to
pthread_yield
and replaced them with wait/signal pairs. (AC-1208)
Version 5.3.3.3 (2021-07-18)
Fixes and other changes:
- Break up sleeps from
ReconnectDelayStrategy
into 1s or smaller chunks to maintain responsiveness to signals. (z13237) (AC-1125) - Prevent possible crash from adding Python message handlers to internal tracking when a client is in the process of being destroyed. This could occur if an exception is thrown leading to client destruction right after a new handler has been added to the client as the tracking is handled by the client receive thread. (AC-1141)
- Fix build issues on Windows with Python 3.10. (z13839) (AC-1159)
- Prevent possible crash from a Python exception listener being invoked by the client receive thread while the Python client is in the process of being destroyed. (AC-1164)
- Improved handling and clarity of SSL errors. (AC-1175)
- Expose
heartbeat
,timeout_interval
,version
, andorder_by
fields onMessage
. (AC-1181, AC-1190) - Fix
RecoveryPoint
class to avoid crashes from double-free and to ensure correct return values rather thanNone
. (AC-1192) - Fix
RecoveryPoint
__copy__
to avoid crashes. (AC-1193) - Fix compilation warnings related to
WSAPROTOCOL_INFOA
and calls to the select function using Linux-style first argument. (AC-1194)
Version 5.3.3.2 (2021-10-12)
Fixes and other changes:
- Fix
MemorySubscriptionManager
handling ofMessageHandler
's for subscriptions that are paused and resumed that could lead to a core dump. (AC-1115) - Fix compilation warnings on 64bit Windows related to formatting
size_t
using%lx
and forcing conversion tobool
. (z13341) (AC-1133) - Fix exception translation from server reason strings for reasons starting with "n", such as "not entitled" and "not supported". (AC-1134)
Version 5.3.3.1 (2021-09-08)
Fixes and other changes:
- Fix deadlock in
HAClient
if a disconnect happens while the client is executing asow_delete
,sow_delete_by_keys
, orsow_delete_by_data
using the asynchronous message processing interface with no message handler provided. (AC-1120) (z13051)
Version 5.3.3.0 (2021-07-20)
New features:
- This release supports IPv6 addresses for AMPS servers. (AC-991)
- New Exception classes have been added to provide more precise exception translation for status codes returned from current versions of the AMPS server. (AC-502)
Client::publishFlush
now takes an optional argument for the ack type to request. A processed ack matches previous behavior. A persisted ack is a new feature that will ensure all previously published messages are safely persisted by the server. (AC-1046)
Fixes and other changes:
- A rare double-free could occur when a client's background thread was canceled after it had already begun to free resoures for exit. (AC-1081)
- An incorrect assert during
MessageHandler
garbage collection has been removed. (AC-1091)
Version 5.3.2.1 (2021-03-15)
New features:
- The Client's name hash used by the server is now available after logon
with the
get_name_hash()
member function. (AC-905)
Fixes and other changes:
Client
now releases references toMessageHandler
s when they are unsubscribed so they can be garbage collected. (AC-456)Client.execute
now properly handles subscriptions with thereplace
option, leaving the currentMessageStream
as handler for the data instead of creating a new one. (AC-893)- Catch exceptions in
FailedWriteHandler
or global command type message handlers and report them to theExceptionListener
if set. Previously, an exception in one of these handlers could shutdown the background receive thread and cause the client to not receive any more messages from the server. (AC-962) - Mask SIGPIPE on Linux to prevent crashes in clients using TLS/SSL. (AC-996)
- Fix
BookmarkStore
implementations to honor persisted acks when resubscribing with a bookmark range. (AC-997) - Fix memory leak when calling the synchronous form of
sow_delete
. (AC-1004) - Fix race conditions in TCPS implementation that could lead to deadlocks or crashes when attempting to reconnect. (AC-1005) (AC-1025)
- Fix possible deadlock when one thread calls
publish_flush
while other threads are callingpublish
. (AC-1009) - Fix race condition in
HAClient
where one thread could send a command to the server between another thread's calls to connect and logon during a reconnect attempt. The extra command would force an attempt at implicit logon and a likely disconnect forcing another reconnect. (AC-1015) - The
delta_publish
function now returns the sequence number of the published message or 0 if none was assigned. This is the same behavior aspublish
. (AC-1016) - Prevent a race condition while accessing the
ReconnectDelayStrategy
inHAClient
. (AC-1017) - Prevent
ExceptionListener
from being called after it is deleted. (AC-1020) - Ids that are automatically generated by the
Client
are now prefixed with "auto" to prevent unintentional clashes with user-specified, numeric ids. (AC-1027) - Prevent deadlocks during destruction of python objects by making sure to release the GIL when calling into C++ code that may acquire locks. (AC-1028)
- The URI option
bind
is now error-checked when applied to tcp sockets. It is a synonym forpath
on unix domain sockets. (AC-1029) (AC-1055) - Calls to
HAClient.connect_and_logon
will reset theReconnectDelayStrategy
before beginning an attempt to connect and logon. Previously, a client disconnected by the delay strategy reaching its maximum timeout value would be unable toconnect_and_logon
without an explicit call toreset
on the delay strategy. (AC-1030) (z12123) - When
unsubscribe
is called, the associatedMessageHandler
will be released within 1 second rather than the next time a message arrives from the server. (AC-1033) (z12228) - Improved hash function is now used in
MessageRouter
to prevent possible collisions on the hash values of subscription ids. (AC-1034) (z12123) - Prevent hang in SSL/TLS clients when using a server with OpenSSL 1.1.1i or newer. (AC-1043)
- Don't lock the
Client
when getting members that shouldn't change while connected:BookmarkStore
,PublishStore
,SubscriptionManager
,URI
, andFailedWriteHandler
. (AC-1053) (z12446) - Fix issue in bookmark stores where they could incorrectly return EPOCH as the most recent bookmark in rare cases where the last discarded bookmark and the last persisted bookmark share the same publisher id. (AC-1198)
Version 5.3.2.0 (2020-09-21)
Breaking changes:
- The
startTimer
andstopTimer
functions onClient
are marked as deprecated. Starting in AMPS server version 5.3.2.0 these commands are no longer available. (AC-969)
New features:
- The Client now has a
setGlobalCommandTypeMessageHandler
function that is used to put in place handlers for all messages of a specific command type, such asack
. AMessageHandler
put in place this way will get invoked for every message of the given type, regardless of if it is also handled elsewhere. (z3407) (AC-450) (AC-565) (AC-658) (AC-675) - Added
amps_client_set_thread_creeated_callback
the C library andsetThreadCreatedCallback
to the C++Client
. This will cause the provided function to be invoked every time a new thread is created by the AMPS client library in reposnse to a successful connection. The calling thread is is the new thread and its handle is provided to the callback. (z9855) (z9764) (AC-516) (AC-907) - A
MemoryBookmarkStore
can now be created with aRecoveryPointAdapter
. The adapter can be implemented to save aRecoveryPoint
somewhere for later recovery to guarantee no missed messages. (AC-527) - A
SOWRecoveryPointAdapter
implementation of theRecoveryPointAdapter
interface have been added. The behavior is to save every update into a SOW topic in the server using a separate client. (AC-756) - A
ConflatingRecoveryPointAdapter
implementation of theRecoveryPointAdapter
interface have been added. The adapter starts a thread that conflates updates before passing them to an underlyingRecoveryPointAdapter
such as aSOWRecoveryPointAdapter
to reduce the number of updates. (AC-965) - Added
setAckType
toCommand
class that will clear the current ack type and use the new type, includingMessage.AckType.None
. (AC-886) - Added an optional flag to the constructor of the file-based bookmark store
classes to tell them to include the file's last modification time in the
most recent bookmark until new, usable bookmarks have been added. This is
useful in the case where the bookmarks in the file may be older than the
bookmarks in the current transaction log to prevent getting
NOW
behavior if no bookmarks are found. (z5314) (z9621) (AC-887) - Added
getQueryId
andsetQueryId
toCommand
class. (AC-927) - Added
getSequence
andsetSequence
toCommand
class. The sequence can be checked after a call toexecute
for commands such aspublish
,delta_publish
, andsow_delete
to get the sequence numer that was assigned by the publish store if one was present. (z11000) (AC-954) - The bookmark range subscription feature, released in AMPS server version 5.3.2.0, is fully supported by all BookmarkStore implementations to support resumable bookmark range subscriptions. (AC-908)
- Added
get_resubscription_timeout
andset_resubscription_timeout
to theHAClient
class to get/set the timeout used by the subscription manager after a reconnect event when resubscribing. The setting is in milliseconds and a 0 value means that there is no timeout. (AC-820) - The
append
method onFIXBuilder
andNVFIXBuilder
now returns the builder object so it can be called repeatedly in a single line. (AC-729)
Fixes and other changes:
- Fix
LoggedBookmarkStore
to throw an exception if corruption is detected during recovery a file and it does not appear to be the final entry in the file. This is done on a best effort basis using the constantsAMPS_MAX_BOOKMARK_LEN
andAMPS_MAX_SUBID_LEN
which are defined ininclude\Field.hpp
. (z9263) (AC-874) - Fix calls to
FailedWriteHandler
to include the sequence number if one was provided on the persisted ack. (AC-884) - Fix Client to not send persisted acks for bookmark subscriptions to the
BookmarkStore
if the subscription is not currently subscribed. Previously, the persisted acks could be delivered and cause missed messages if everything in the store had been dicarded. (z10045) (AC-912) - Fix
Client
to return an emptyMessageStream
any time aCommand
will not return any messages or acks. Previously, commands such assow_delete
that did not request astats
ack could hang if you attempted to iterate the returnedMessageStream
. (AC-964) - Destroying a
MessageStream
that is only going to receiveack
messages before they have all arrived can no longer lead to a seg fault. (AC-975) - Fix URI parser to handle percent-escape characters in compliance with RFC 3986 and 1738. (z11551) (AC-987)
- An exception during
Client.execute
can no longer cause a seg fault when the same subId or command id is used in another command. (z11017) (AC-983) - Calling
set_transport_filter_function
on aClient
that is not yet connected will no longer cause a core dump. (AC-968) - Fix possible core dumps during process shutdown with active subscriptions using Python version 3.7 and newer. (z11320) (AC-972)
- Fix build to use the same python binary to build the C library as is used to build the C++ module on Linux. (AC-992)
- Fix potential deadlock when calling
get_unpersisted_count()
on a Client during a reconnect. (z11717) (AC-993)
Version 5.3.0.6 (2020-09-03)
Fixes and other changes:
- Fix issue where an HAClient using a tcps connection could get disconnected and not automatically reconnect. (z11623) (AC-989)
Version 5.3.0.5 (2020-04-30)
Fixes and other changes:
- Fix issue where acks that were not requested by the application could be
delivered to the
lastChanceMessageHandler
, if one is set. The fix for AC-946 in 5.3.0.4, to route more types of ack messages to the handler, exposed this issue. (z11045) (AC-956)
Version 5.3.0.4 (2020-04-20)
Fixes and other changes:
- Removed all warnings found using clang-9, g++ 9.2, and -std= flags: c++11, c++14, c++17, and c++2a. (z01836) (z10987) (AC-928) (AC-952)
- Fixed a possible use after free error that could occur during destruction
of a
Client
that had returned at least one emptyMessageStream
from a call toexecute
. (AC-951)
Version 5.3.0.3 (2020-03-04)
Fixes and other changes:
- Fixed a memory leak that would occur if a
MessageStream
had a timeout set and the attempt to get the nextMessage
timed out. (AC-949) (z10724) sow_and_delta_subscribe
will now properly throw aTimeoutException
if theprocessed
ack is not returned in time. (AC-934)- Client now builds correctly with Python 3.8. (AC-942) (z10560)
- All ack types not handled elsewhere will now properly reach the last
chance handler, if set. Previously, only
processed
andpersisted
acks were being delivered to the last chance handler. (AC-946)
Version 5.3.0.2 (2019-11-06)
Fixes and other changes:
MessageStreamImpl
destruction is now deferred to the receive thread to prevent a race condition between its destruction and its message handler being called. This could result in a situation where no further messages would be processed for the connection. (AC-918) (z10063)FixedReconnectDelayStrategy
andExponentialReconnectDelayStrategy
no longer reset the timer used to check for exceeding the maximum retry time when a new URI is tried. The timer will only restart when the first attempt is made after a successful connection (or construction of the delay strategy). (AC-771) (z7165) (z9674) (z9820)- A
MessageStream
object that fails to auto ack a queue message will close in an error state. (AC-897) - Disconnecting a client will no longer throw an exception if batched queue acks fail to flush. (AC-920)
- Acks for queue messages that were saved in an ack batch will not be lost when a client is forced to reconnect. (AC-921)
Version 5.3.0.1 (2019-08-06)
Fixes and other changes:
- A socket leak under some reconnect scenarios in the underlying C client has been corrected. (z9708, z9736, z9741) (AC-898)
Version 5.3.0.0 (2019-07-08)
Breaking changes:
- Support for AMPS server versions before 4.0.0.0 has been removed from the
BookmarkStore
classes to improve their performance. (AC-391)
New features:
- Added
Select
andExpire
toMessage.Options
. (AC-882)
Python version 5.2
Version 5.2.4.0 (2019-05-15)
Breaking changes:
- The default batch size for all sow queries has been changed to 10. (AC-700)
- The
BlockPublishStore
implementation which underlies all publish stores has been changed to reduce the time required to resize. The file format has also changed, but old format files should be recovered correctly and rewritten by the new implementation. The rewritten files will no longer work with earlier client versions. (AC-817) - The
RingBookmarkStore
class is now available in the Python client. (AC-847) - The C and C++ code are now built in separate steps on Linux so there are no longer any compilation warnings from flags that only apply to one of those languages. (AC-863)
- The Windows build system has been updated to use the latest version of Microsoft Visual Studio found in the environment. (z9247) (AC-869)
Fixes and other changes:
- Clients will no longer double-ack messages from a Queue when auto ack has been enabled
and the code is also calling
ack
for theMessage
. (AC-489) - Clients will now automatically set an ack timeout when an application sets the
ack batch size and the ack timeout is set to
0
(never timeout). When the ack timeout is0
, the Client will automatically set a default ack timeout of 1 second when the ack batch size is set. (z5223) (AC-666) - Removed a potential hang in
HAClient
that was caused by trying to flush ack messages during reconnect. (AC-690) - A subscription that throws an exception when placed will now be removed from
the
SubscriptionManager
if one is present. (z5943) (AC-709) MessageStream
objects returned for non-subscribe commands now properly mark themselves as closed when all expected acks have been returned. (AC-815)- The read timeout on a connection can no longer exceed the heartbeat interval if a heartbeat is set. (AC-819)
MessageStream
objects produced by aClient
with auto ack enabled will now ack the messages after the next message is requested. Previously, acks were sent as soon as messages were saved in theMessageStream
which could lead to unprocessed messages being acked if a client processs exited with messages still held in theMessageStream
. It could also completely drain a message queue since messages were being acked immediately upon arrival. (AC-825)LoggedBookmarkStore.prune
now cleans up files that have only accumulated new persisted bookmarks. Previously, only a change in the last discarded bookmark would causeprune
to modify the file. (z8434) (AC-831)- Fork handling has been implemented to prevent deadlocks when using multi- processing. (AC-832)
LoggedBookmarkStore.prune
will now retry file delete and rename operations in case of slow file system updates. (z7614) (AC-836)- Added
AMPS.ssl_set_verify
andAMPS.ssl_load_verify_locations
functions to enable certificate verification. (AC-839) - Removed potential hang in
HAClient
if an exception was thrown during logon and the background thread was attempting to flush queue acks. (AC-840) - Fixed possible hang or missed acks when a disconnect occurred while sending
sow_delete
commands. (z8567) (AC-841) - Fixed incorrect parsing of
amps
protocol messages containing a topic with a trailing / character. (z8648) (AC-843) - Fixed
sow_and_subscribe
to no longer settop_n
on all queries. This bug first appeared in version 5.2.3.0. (AC-845) - Fixed
BlockPublishStore
to always restore_resizing
to false and prevent a hang if there is an exception while attempting to grow. (z8769) (AC-853)
Version 5.2.3.0 (2018-09-14)
New features:
- The
Client.logon
function can now be called with an options string, such as "ack_conflation=500ms" (AC-792). - The
HAClient
class now hassetLogonOptions
andgetLogonOptions
functions to set the options to be used forlogon
each time it's called (AC-792). - The
VersionInfo
class has been introduced to provide an encapsulated way to represent and compare server versions.Client.get_server_version_info()
returns the new type (z7665) (AC-789). - OpenSSL version 1.1.0 and higher can now be detected and used for tcps connections. (AC-800)
- Added
Client.set_transport_filter()
to provide a cross-transport way of adding a filter function. (AC-803) - Added
Message.get_data_raw()
to provide access to data on a message as bytes rather than a string when using Python 3. In Python 2, bytes are returned by bothget_data()
andget_data_raw()
. (AC-793)
Fixes and other changes:
- Error messages from a failure in
getaddrinfo()
are now properly thrown by theClient
(z7935) (AC-801) - The
Client.ack(topic, bookmark)
function no longer erroneously places the bookmark in the options field causing the ack to fail (z7882) (AC-802). - The
ampspy_types.hpp
header no longer depends on the client itself providing an implementation of anyPy*
functions. The client provides these functions when building with a version of Python that does not provide a given function. This is a common approach to Python version compatibility: this change was made to avoid conflicting with definitions in customer applications that are designed to work with both Python 2 and Python 3. (z7924) (AC-809).
Version 5.2.2.2 (2018-07-06)
Fixes and other changes:
- Fix issue with gcc 5.2 and address sanitizer where a cast from
Client&
toHAClient&
during disconnect handling would cause address sanitizer to report an error. More recent versions of gcc were not affected. (AC-788) (z7645) - Fix race condition with functions returning
MessageStream
where the subscribe family of calls could potentially not send the subscribe command to the server during a reconnect, so theMessageStream
would always be empty. (AC-787) (z7622) - Fix potential deadlock between the python GIL and the
Client
lock when using bothMessageStream
and aConnectionStateListener
. (AC-790) (z7676)
Version 5.2.2.1 (2018-06-12)
Fixes and other changes:
- Fix
Client.unsubscribe(id_)
to properly throwDisconnectedException
if theClient
is disconnected when calling the function. Previously, this could hang. (AC-772) - Fix
Client
to only addMessageHandler
s for new identifiers (command, subscription, or query). (AC-773) - Fix compilation errors when using Microsoft Visual Studio 2010. This compiler version has not been covered by Microsoft mainstream support since 2015, and will not be supported after this release. (AC-779) (z6468)
Version 5.2.2.0 (2018-04-04)
Breaking changes:
- The
ConnectionStateListener
class has been expanded to include:LoggedOn
,HeartbeatInitiated
,PublishReplayed
,Resubscribed
, andShutdown
states.Shutdown
indicates that theClient
has been disconnected and is not going to try to reconnect itself. A client shouldn't be used to execute AMPS server commands until after a listener has received either theLoggedOn
state for aClient
or theResubscribed
state for anHAClient
. Note: enum value order and associated int values have also changed. (AC-457) (z3494, z6468)
New features:
- Added a second, optional argument to
Client.add_connection_state_listener
to specify the version of your listener.Client.ConnectionStateListener.EXTENDED_STATES
indicates it expects the int values above. The default, or any version less than that such asClient.ConnectionStateListener.ORIGINAL_VERSION
indicates it expects onlyTrue
orFalse
for connected or disconnected (includes SHUTDOWN). - Added
Client.set_default_max_depth
,Client.get_default_max_depth
,MessageStream.get_max_depth
, andMessageStream.get_depth
methods to control the max depth on newMessageStream
objects created by theClient
and to monitor the depth on theMessageStream
. (AC-680) (z5557) - Added ability to bind outgoing connections to a server to a specific local
address or port using
?bind=addr[:port]
in the URI. (AC-701) (z6000) - Added an optional string argument to
Client.ack
andMessage.ack
methods to allow passing of an options string, such as "cancel". (AC-726) - Removed possible memory leak of a
MessageStream
when an exception is thrown byClient.execute
. (AC-751) - Added ability to use pretty printing of binary message types as the data
format by specifying
?pretty=true
in the URI. (AC-755) - Fixed possible core dump if
HAClient
was destroyed while a thread was still trying to reconnect. (AC-761) - Added missing
Message.is_records_updated_null
method. (AC-669)(z5530)
Fixes and other changes:
- Fix
Client.unsubscribe
to properly throwDisconnectedException
if theClient
is disconnected when calling the function. Previously, this could hang. (AC-760) (z6892) - Fix
Client.unsubscribe
to properly remove allMessageHandler
s in place for subscriptions. (AC-768) - Fix a possible deadlock in
HAClient
that could occur iflogon
fails while trying toconnectAndLogon
. (AC-769) (z7057) (z7103)
Version 5.2.1.6 (2018-01-11)
Fixes and other changes:
- Fixed memory leak when command execution results in an exception. (AC-715)
- Fixed race condition which could result in a deadlock during disconnect handling. (AC-750)
Version 5.2.1.5 (2018-01-03)
Fixes and other changes:
BlockPublishStore.store()
now properly reclaims memory used and prevents the partialMessage
from being replayed. (AC-734)- The
Client.convertVersionToNumber()
function, used byClient.getServerVersion()
, now treats any portion of a version that is larger than 99 as 99. (AC-730) - Fix race condition in the
MessageRouter
class that could cause improper message routing or even a crash. (Z6536) (AC-748) - Remove a compiler warning in
mmapbookmarkstore.cpp
introduced in version 5.2.1.4. (Z6503) (AC-746) - The
HAClient
disconnect handling could incorrectly stop retrying to connect when failing to connect multiple times. (Z6468) (AC-749)
Version 5.2.1.4 (2017-12-15)
Fixes and other changes:
-
Message queue cancel acks are now properly stored with the cancel option in all store classes, and will not be replayed during a reconnect event to prevent an incorrect cancel of a message. (AC-732)
-
Messages that do not contain a bookmark will no longer create an invalid sow_delete ack message if the
ack()
method is called. (AC-733) -
Clients that had called
set_ack_timeout()
could hang and consume 100% cpu if the server connection was lost. (Z6472) (AC-741) -
Methods to access and set the
MessageType
,RecordsInserted
, andRecordsUpdated
fields were added to theMessage
class. (AC-669)
Version 5.2.1.3 (2017-11-17)
Fixes and other changes:
- An embedded NULL in an amps protocol header field no longer causes the client to disconnect. (AC-694)
- Fixed a number of issues when using a
Store
on aClient
that is consuming from an AMPS Queue. Issues included incorrect unpersisted count, incorrect duplicate detection, hangs while trying toflush
theStore
, and large memory growth of theStore
. (AC-707) (AC-708) (AC-711) (AC-712) - Updated exception messages to include the method name when there is an
error setting a
Field
on aMessage
. (AC-714) - Fixed calls to
sowDelete*
functions to remove theMessageHandler
if a timeout occurs. (AC-717) - Fixed
MemorySubscriptionManager
to prevent subscriptions from being deleted while they are being resubscribed. (AC-717)
Version 5.2.1.2 (2017-09-27)
Fixes and other changes:
- Improved performance of recovery of the file-based bookmark store classes:
MMapBookmarkStore
andLoggedBookmarkStore
. (AC-683) (Z5652) - Improved
prune
function forMMapBookmarkStore
andLoggedBookmarkStore
to only prune the file when the prune will change the size of the file. (AC-684) (Z5652)
Version 5.2.1.1 (2017-05-12)
New features:
- The
bookmark_delta_subscribe
function has been removed fromClient
as the AMPS server does not support this operation. (AC-646) - Added
Client.setRetryOnDisconnect
method that allows for commands being sent to the server to not retry if they fail the first time. (AC-635)
Fixes and other changes:
- Fix build warnings and errors on Windows with older compilers. (AC-641) (Z4888)
- Fix
MMapBookmarkStore.prune()
to start with the default file size rather than the size of the current store file. (AC-642) (Z4909) - Fix recovery of file-based bookmark stores to have a most recent of EPOCH when there were messages logged but no messages discarded. (AC-643)
Command
object reuse will no longer cause unrequested acks to be delivered to the message handler. (AC-645)
Version 5.2.1.0 (2017-03-08)
New features:
- Added support for python3
Fixes and other changes:
- Fix non-deterministic core dump caused by calling
PyCallable_Check
without holding the GIL. (AC-615)
Version 5.2.0.0 (2017-02-09)
New features:
- Added new options for 5.2.0.0 and newer AMPS servers (AC-584) (AC-605):
SkipN
Projection
Grouping
Fixes and other changes:
- Fix possible core dump from recursive GC involving
Client
andMessageHandler
objects saved in theClient
. (AC-607)
Python version 5.1
Version 5.1.0.0 (2017-01-31)
New features:
- Expose additional methods from
MemoryBookmarkStore
andMMapBookmarkStore
. (AC-471)log
discard_message
discard
get_most_recent
is_discarded
persisted
persisted_index
purge
get_oldest_bookmark_seq
no_persisted_acks
set_server_version
- Added new function
setResubscriptionTimeout
toMemorySubscriptionManager
class to change a non-static value used for timeouts during resubscription. Previously, there was only a single static value. (Z3372) (AC-461) - Added new get functions to
Client
for heartbeat interval and read timeout. (Z3720) (AC-508) - Added new options for 5.1.0.0 and newer AMPS servers (AC-532) (AC-543):
Conflation
ConflationKey
FullyDurable
RateMaxGap
- Added new function
purge_sub_id
to theBookmarkStore
implementations. This function will completely remove all records for the given subscription id from the store. (Z4087) (AC-540) - Add support for Visual Studio 2015. (AC-470)
Fixes and other changes:
- Allow
Client.setHeartbeat()
to be called before connecting. (AC-509) - Options no longer have a trailing
,
when sent to the server. (AC-431) - Prevent multiple threads from calling
HAClient.connectAndLogon
at the same time. (AC-449) - The
MemorySubscriptionManager.DefaultResubscriptionTimeout
has been changed to 0, or no timeout. (Z3372) (AC-460) - Updated
LoggedBookmarkStore.prune
function to be more complete in what is saved in the pruned file. There was a small possibility for duplicate messages being delivered. (AC-479) (AC-523) - Differentiate
NotEntitledException
message between logon and other commands. (AC-511) - Fix
MemorySubscriptionManager
to reset state properly if there is an exception during resubscribe. Previously, it could produce a deadlock. (Z3928) (AC-519) - Fix
PublishStore
so that messages larger than 2048 * _blocksPerRealloc no longer can cause a crash. (AC-512) - Fix compilation warning on Windows. (AC-475)
- Fix protocol error using non-numeric SOW keys. (AC-515)
- Optimize message delivery when messages are arriving for the same subscription id. (AC-521)
- Fixed
PublishStore
to avoid the possibility of possible corruption during a resize while multiple threads are publishing with the same client and the client is forced to reconnect. (AC-534) - Fixed
Client
to prevent simultaneous message processing in a rapid disconnect/connect scenario that could lead to message corruption. (AC-535) - Fix threading issues when using tcps transport that could lead to hangs or incorrect data. (AC-558)
- Fix race condition that could put in place an incorrect
MessageHandler
for a subscription ifMemorySubscriptionManager
is doing a resubscribe while another thread is updating the same subscription with a replace, pause, or resume. (AC-559) - Fix
FixedDelayStrategy
so that a maximum of 0 always means retry indefinitely. (AC-561) - Fix
Client
so that a call toget_unpersisted_count
does not segfault if no publish store has been set. (AC-536)
Python version 5.0
Version 5.0.1.2 (2016-08-25)
Fixes and other changes:
- Fix issue where an ack would be delivered to the last chance message handler when acking a message from a queue. (Z3513) (AC-472)
- Fix issue where a long-running python thread could block the Client receive thread after it sends a heartbeat response. (Z3460) (AC-499)
- Fix bug where a
Client
with aPublishStore
could have its publish messages seen as duplicates by the server if the client was also acking messages from a queue. (Z3609) (AC-490)
Version 5.0.1.1 (2016-06-13)
This version contains the following additions and fixes:
- Fix
sow_delete_by_data
to accept data with embedded nulls. (Z3392) - Fix
HAClient
to retry connecting ifreportSuccess
on theServerChooser
throws an exception. (Z3256) - Fix bug in
Client
that could cause aLoggedBookmarkStore
orMMapBookmarkStore
to have an incorrect value for most recent for AMPS servers version 4.0.0.0 and above. (AC-447) - Provide the ability to implement
BookmarkStore
andPublishStore
in Python (in addition to C++). Stores implemented in Python can be used with the HAClient.
Version 5.0.1.0 (2016-05-26)
This version includes the following changes and fixes:
New features:
- This release adds support for secure socket layer (SSL) encryption of connections to AMPS, supported in 5.0.0.0 and higher versions of the AMPS server. See the developer guide for information on adding SSL support to your applications. See the most current AMPS User Guide and AMPS Configuration Reference for creating a Transport that uses SSL.
Fixes and other changes:
- Fix bug in
LoggedBookmarkStore.prune
andMMapBookmarkStore.prune
that could result in invalid bookmarks or invalid entries in the store. (Z3165, Z3268) (AC-439)
Version 5.0.0.1 (2016-03-25)
Client
properly processes connection options (for example,tcp_nodelay
), fixing a bug introduced in 5.0.0.0 that would cause the client to throw an exception in some cases when connection options were present. (Z3119)Client
will now respond to authentication challenges with user id sent by the server in its response. (Z2993)BookmarkStore
implementations will now return a list of bookmarks as the MOST_RECENT when:- The original subscription was for NOW,
- Some bookmarks have been discarded, and
- No persisted ack has yet been received from the server. (Z3106)
Version 5.0.0.0 (2016-02-29)
This version is a major update of the AMPS Python client. It includes feature support for new features in AMPS 5.0.0.0, including:
- Awareness of message queues, including options to enable automatic acknowledgement of queue messages, set a batch size for automatic acknowledgement, and so forth.
- Support for pause and resume on bookmark subscriptions. The AMPS
Python client is now aware of the
pause
andresume
options for bookmark subscriptions, and stores the state of a bookmark subscription in theSubscriptionManager
to re-establish the connection in the correct state when failover occurs.
This version also includes the following fixes and improvements:
- Update version in underlying C++ client to match version of the python client, so that the version number sent to the AMPS server is meaningful. (AC-370)
- Fixed
NVFIXBuilder
andFIXBuilder
to stop leaking a pythonString
object when converting appended values from a non-string type (Z2017) - Attempting to set a store on a client that is already connected will now
throw an
AlreadyConnectedException
instead of aUsageException
. (AC-306) - Calling
connect
on anHAClient
will now forward the call toconnect_and_logon
. (AC-306) - Attempting to call
logon
on anHAClient
will throw anException
stating to useconnect_and_logon
. (AC-306) DefaultServerChooser
now has anadd_all
function that will take a list of uri strings to be added in order. (AC-361)- Client will invoke the
FailedWriteHandler
for all failures. Previously it was only invoked for duplicate and not entitled failures. (AC-339) - Added
NoTopic
to theReason
class. - The version sent to AMPS in logon is now
getVersion() + ":python"
to aid in debugging. (AC-385) - Added
add_message_handler
andremove_message_handler
functions to Client so the non-blocking version ofsend
can be used and results will still be handled. (AC-333) - The
TransmissionTime
field has been renamed toTimestamp
. - The following deprecated fields have been removed from
Message
(AC-294):MaximumMessages
(max_messages
)MessageID
(message_id
)SendEmpty
(send_empties
)SendOutOfFocus
(send_oof
)SendSubscriptionIDs
(send_matching_ids
)
- Change all
Store
implementations to set the initial sequence number to a large value based on current time. This prevents backtracking in sequence numbers when simultaneous server and client failures occur and replication is in use. (Z1986) (AC-384) - Change the timeout argument of
publish_flush
to be a keyword argument rather than just positional. (Z2189) - Fix
MessageStreams
with a timeout set so theMessageStream
will end iteration for commands that have a defined end point, such as sow queries. Previously,MessageStreams
with a a timeout set would continue to produce invalid messages after receiving thegroup_end
for a sow command or when a stats ack is returned and the ack is the only message expected. - Fix
Client.set_transport_filter
to throw an exception instead of crashing when called on a not-connected client. (Z2217) - Changed the
send
,execute
andexecuteAsync
methods onClient
to return all acks that are set on theCommand
object to theMessageStream
orMessageHandler
. Previously, acks that were used internally in theClient
, such as processed acks, were blocked from being returned. (AC-332) - Changed failed write handler interface to accept a
Message
and a reason string. Handlers with the old interface should continue to work in this release. PublishStore
will recover up to the first corrupt message, then clear corrupt data before throwing an exception so that the store and its file are recoverable. (AC-404) (Z2458)PublishStore
has a new functiontruncate_on_close(boolean)
, which, if set toTrue
will cause an emptyPublishStore
to attempt to truncate its file toinitialSize
blocks when it is closed. (AC-405) (Z2255)- Added
Pause
,Resume
, andRate()
toMessage.Options
for buildingCommand
options strings. (AC-406) - Added support for passing a
Client
to a user-defined C/C++ function through thectypes
interface. (AC-420)
Python version 4.3
Version 4.3.1.5 (2016-12-18)
This version contains the following additions and fixes:
- Fix possible
SEGV
during garbage collection ofClient
. (Z2559) (Z2585)
Version 4.3.1.4 (2015-11-18)
This version contains the following additions and fixes:
- Restored synchronous behavior of
Client.sow_delete_by_keys
when noon_message
parameter is supplied. In versions 3.8.1.x, callingsow_delete_by_keys
with no message handler resulted in synchronous execution followed by the return of the "stats" message from the server. In versions 4.0.0.0 through 4.3.1.3, this same usage resulted in an error. (Z2485)
Version 4.3.1.3 (2015-09-15)
This version contains the following additions and fixes:
- Fixed
ExponentialDelayStrategy
to never exceed the maximum delay, even when using jitter. (Z2190) - Fix
ExponentialDelayStrategy
on Windows to properly retry for the entiremaximumRetryTime
. (Z2190)
Version 4.3.1.2 (2015-08-20)
This version contains the following additions and fixes:
- Fixed
NVFIXBuilder
andFIXBuilder
to no longer leak a pythonString
object when converting appended values from a non-string type. (Z2017) - Fix
SEGV
when anAMPS.Client
is deleted by the python garbage collector and thatClient
has an exception listener registered where the exception listener has a circular reference to the deletedClient
. (Z2090) - Fix
Client
to properly process authenticationretry
acks.
Version 4.3.1.1 (2015-07-22)
This version contains the following additions and fixes:
- Prevent possible OOM when a
MessageStream
is resubscribed after a disconnect and never closed. - Fix to make sure that messages reported by AMPS as not entitled are discarded from the client's publish store. (Z1961)
- Update version in underlying C++ client to match version of the python client, so that the version number sent to the AMPS server is meaningful. (AC-370)
- Modify
SyncSOWDeleteMessageHandler
state to be volatile to avoid a possible race condition and add a default timeout (Z1894). - Pass exception and traceback object to user-supplied exception listeners. (AC-394)
Version 4.3.1.0 (2015-06-03)
This version contains the following additions and fixes:
- Added new classes
CompositeMessageBuilder
andCompositeMessageParser
for working with composite message types. - Added new method
MessageStream.timeout()
to set the timeout when calling thenext
method, or when iterating over a message stream. - Calling
set_heartbeat
on anHAClient
that is not connected will no longer throw aDisconnectedException
. (Z1570) - Fixed object reference leak when destroying a
Client
orHAClient
object. (Z1613) - Added support for garbage collection and cyclic references to
Client
andHAClient
. (Z1627) - Added new class
FixedDelayStrategy
andExponentialDelayStrategy
, along with setter and getter onHAClient
. These classes and methods provide custom and advanced sleeping strategies when failing over. - Added support for weak references to
Client
andHAClient
. (AC-325, Z1623) - Allow
None
to be passed toset_disconnect_handler
,set_last_chance_message_handler
,set_duplicate_message_handler
, andset_exception_listener
, in order to "unset" the handler. (AC-320, Z1609) - Added
Client.get_exception_listener
andClient.get_duplicate_message_handler
. (Z1608, AC-319) - Removed
ServerChooser.next()
. (AC-114) - Added optional "timeout" parameter to
Client.publish_flush
(AC-326) - Ensure that messages are saved to publish store and sent sequentially when multiple threads are calling publish and sowDelete functions on the same client at the same time. (Z1617) (AC-217)
Python version 4.0
Version 4.0.0.6 (2015-05-08)
This version introduces the following new features and fixes:
- Fixes race condition in Client
sow
,sow_and_subscribe
,sow_delete
, andsow_and_delta_subscribe
methods where the returned command ID or subscription ID may be incorrect when using aClient
from multiple application threads. (Z1700) - Fix to make sure that messages reported by AMPS as duplicate or not entitled are discarded from the client's publish store. (Z1640)
Version 4.0.0.5 (2015-04-28)
This version introduces the following new features and fixes:
- Fixed fatal error that could occur when a program receives
SIGINT
(or Ctrl+C is pressed) while anHAClient
is attempting to reconnect and the signal causes a user-supplied exception listener to be called. (Z1714)
Version 4.0.0.4 (2015-04-14)
This version introduces the following new features and fixes:
- Unhandled exceptions from a user message handler that are thrown in response to a sow, group_begin, or group_end message are now caught and sent to the user-supplied exception listener. (Z1649)
- Setting an exception listener on a
Client
no longer causes a crash or hang at exit when aMessageStream
object outlives aClient
. (Z1656)
Version 4.0.0.2 (2015-03-03)
This version contains fixes for the following issues:
- Fixed process hang at Python interpreter exit when using a global
HAClient
instance on Windows. (Z1541) - Fixed compiler warnings when compiling the client library 32-bit on Linux. (Z1528)
- Correctly set the version string for the Python client on build. (Z1529)
Version 4.0.0.1 (2015-02-20)
This version contains fixes for the following issues:
- Fixed race condition that leads to an occasional
SEGV
when disconnecting a client, or when shutting down while a client is connected. (AC-283) - Fixed crash that may occur when a
MessageStream
is still receiving messages while the calling program exits. (Z1407) - Changing the
BookmarkStore
orPublishStore
on a connected client raises aUsageException
. (Z1407) - Fixed silent failure when calling
FIXBuilder.append()
with a non-integer key. This failure sometimes results inTypeError
being thrown from unrelated parts of your program.
Version 4.0.0.0 (2014-12-08)
This version of the AMPS Python Client is a major update to the programming interface. It introduces new functionality, and is not fully source compatible with previous versions. See the section on "Updating Applications to 4.0.0.0 in this HISTORY file for information on updating applications.
This release contains the following breaking changes:
- Renamed
set_unhandled_message_handler
toset_last_chance_message_handler
. (AC-197) - Renamed
published_duplicate_handler
tofailed_write_handler
. (AC-280)
This version introduces the following new features and fixes:
- Fixed race condition that leads to an occasional
SEGV
when disconnecting a client, or when shutting down while a client is connected. (AC-283) - Add new
Command
class to facilitate more flexible and easier execution of AMPS commands, along withexecute
andexecute_async
methods onClient
to execute aCommand
. - Added the ability for the AMPS Python client to load and use message handlers implemented in C++. See the developer guide and the API reference for details.
- Include the AMPS Command Reference in the client distribution to provide
a guide to using the new
Command
class. - Removed 22-character limit from command, subscription, and query IDs (AC222)
- Record
sow_delete
operations in publish stores so that, during replay,sow_delete
andpublish
messages are replayed in the same order they were originally sent. (AC207) - Disallow subscriptions with the
"replace"
option when no subscription ID is passed, to help prevent programming errors with this option. (AC153) - Ensure the appropriate subscription ID is used for bookmark logging when multiple subscriptions to the same topic are placed.
- Add
RecordsInserted
,RecordsUpdated,
andOrderBy
fields toMessage
. (AC106) - Add CDATA escaping to topic and filter fields for XML protocol. (AC216)
- Store and use multiple bookmarks to avoid missing messages when failing over between replication pairs.
- Increased robustness of
publish_flush()
method by using newflush
command on the AMPS server when available. (AC182) - Cause all
sow_delete
methods to request astats
ack from the server. - Added support for
orderby
,bookmark
, andtopN
arguments tosow
,sow_and_subscribe
, andsow_and_delta_subscribe
. - Added optional
sub_id
parameter to all subscription methods onClient
.
Updating Applications to 4.0.0.0
The set_unhandled_message_handler
method has been renamed to
set_last_chance_message_handler
. Replace calls to the function with the
new name.
Throughout the client, message_type
has been renamed to protocol
.
Version 3.8.1.1 (2014-09-19)
This release of the Python client is compatible with 3.8.1.0
This version contains fixes for the following issues:
Client.disconnect()
no longer clears the URI for the client. (Z1057, AC-252)- Correctly lock the URI for the client when accessing it to protect against concurrent updates. (Z1057, AC-252)
- Deep copying a
Message
now correctly copies the bookmark sequence number of theMessage
. (Z958)
Version 3.8.1.0 (2014-07-29)
This release of the Python client adds new client-side functionality. The client does not remove any interfaces and is source compatible with previous releases of the client. However, this release of the client does change the format of publish store files.
This version contains fixes for the following issues:
- Publish stores now store message expiration. This fix includes a change to the file format for file-based publish stores. This version of the client will correctly read files from previous versions of the client. However, previous versions of the client cannot read publish store files created by version 3.8.1.0 and later of the client. (Z880)
- Applications that use a
Store
will no longer lose the first published message after recovery. Previously, if the Store had exactly 1 unsent message during recovery, the client would reuse a message sequence number, making the message appear to be a duplicate. (AC200) - Clients that use a file based
PublishStore
no longer lose messages when the application is restarted with unpublished messages. Previously, errors in recovery would cause unpublished messages to be lost. (AC200) - Clients that use a
PublishStore
can no longer incorrectly try to resize to very large sizes after replay. This behavior could cause out of memory errors. (AC200) LoggedBookmarkStore
will no longer throw an exception if there is file error after some data has been recovered and will instead stop recovery after the last good record. This prevents abrupt client shutdowns leaving the entire file corrupt rather than just the final record. (AC196)- Fix unresponsiveness to Control-C that could occur when trying to connect
in
HAClient
connect_and_logon
or when trying to publish while the reader thread is trying to connect inHAClient
connect_and_logon
(Z895).
This version also adds the following new functionality:
-
Added new synchronous versions of
subscribe
,sow
,sow_and_subscribe
,sow_and_delta_subscribe
, andsow_delete
. The new versions of these methods no longer require a message handler. Instead, these versions of the methods return aMessageStream
which can be used for iteration. When there are no more messages available, iteration is complete and the stream is automatically closed. For example, the new version ofsubscribe
can be invoked as:for message in client.subscribe("my-sow-topic"):
print message.get_data() -
Added new
sow_delete_by_data()
function. This function takes a topic and a message. AMPS uses the provided message to identify the SOW record to delete. AMPS deletes the record that would be updated by the message provided. -
Added
get_server_version()
function toClient
to return the version of the connected AMPS server. This function returns a numeric value with the pattern:Major Minor Maintenance Hotfix
Two digits are available for each part of the version. For example, AMPS server version 3.8.1.5 will return
3080105
. This is supported for all versions of AMPS 3.8 and later. If the client is connected to an earlier version of AMPS, this function will return 0. (Z884) -
Added
get_server_version_from_string()
function toClient
to return the numeric value for a given version string for comparison with values returned byget_server_version()
. This function can work with shortened version strings such as"3.8"
which will return3080000
. -
Added
VERSION
string to AMPS for the client version and fixed version insetup.py
to be the current version. (AC-169)
Version 3.8.0.3 (2014-05-06)
- Updated API documentation with correct units for timeout. (Z771)
- Prevent possible deadlock on Windows when two or more threads call a synchronous method on the same client at the same time. (Z763)
- Enable message handlers on one client to call synchronous methods
(like
sow()
,logon()
) on another client. (Z763)
Version 3.8.0.2 (2014-03-11)
- Improved thread safety of client. Using the same client object in
multiple threads will no longer produce a
"Fatal Python error: deallocating None"
error. - Eliminated the possibility of receiving a
"TypeError: an integer is required"
error when passingNone
as an expiration value topublish
anddelta_publish
.
Version 3.8.0.1 (2014-02-24)
- The
None
keyword is now accepted for message expiration for bothpublish
anddelta_publish
. - Publish functions now accept keyword arguments.
- The expiration field in published messages had an unnecessary trailing
NULL
byte. This is no longer sent. - The
send
function now ensures thatackType
and all necessary IDs are properly set for all types of messages.
Version 3.8.0.0 (2014-02-21)
- Change version number so that major/minor version matches server release. There are no AMPS Python client releases versioned 3.3 through 3.7.
- Include the most recently certified C++ client sources into the Python
client package. You no longer need to download a C++ client or set
AMPS_CPP_DIR
to build the Python client. You can still setAMPS_CPP_DIR
if you choose to use a C++ client other than the one included in the Python client package. - Change version number so that major/minor version matches server release. There are no AMPS Python client releases versioned 3.3 through 3.7.
- Improve interface for replacement subscriptions. Add new
sub_id
optional parameter to various subscribe commands onClient
to make it easier to do replace requests and allow them to update the defaultMemorySubscriptionManager
in theHAClient
. - Protect against unbounded store growth. Add new
setResizeHandler
functions on the publish and bookmark store classes so clients can take action when a store is growing. - Fix bug in reference counting on
ServerChooser
when using a customAuthenticator
, which caused a SEGV when using a new-style class as a customAuthenticator
. - Cause the "reason" field of the "info" dictionary passed to
ServerChooser
report_failure()
to contain the text of any python exception encountered, instead of "a python exception occured." - Fix unresponsiveness to Control-C that could occur when tring to connect
in
HAClient
connect_and_logon
.
Version 3.2.0.2 (2013-12-11)
- Add new wrappers for
PublishStore
,MemoryPublishStore
,MMapBookmarkStore
andMemoryBookmarkStore
,HybridPublishStore
. Add methods forset_publish_store
andset_bookmark_store
. - Add a new
HAClient
constructor keyword argument,no_store
, to prevent bookmark and/or publish stores from being created in memory. - Add support for new C++ client api,
Client.publish_flush
(publishFlush
in C++). - Fix for possible crash when multiple clients subscribe within a single application.
- Update
RECENT
bookmark toMOST_RECENT
to match documentation and other languages.
Version 3.2.0.1 (2013-11-22)
- Add new
HAClient.connect
with a more helpful exception when no argument is passed. - Fix
SEGV
that occurs when an uninitializedHAClient
is freed.
Version 3.2.0.0 (2013-11-15)
Initial release of this implementation.
- Re-written as a Python extension module atop the AMPS C++ Client,
including
HAClient
functionality. - Added
sow_delete_by_keys
. - Added
FIXShredder
- Reorganized
Exception
hierarchy to make current exceptions inherit from legacy exceptions.