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.setDisconnectHandlerhas 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
setDisconnectHandleron anHAClientwill throw aUsageExceptionas 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_foundoption available in AMPS server 5.3.5.0 and above is now supported in theMessage.Optionsclass. (AC-1338)
Fixes and other changes:
- Passing
AMPS_DEFAULT_TOP_NtoCommand.setTopNwill now correctly unset any topN value and not send a very large number. (z13291) (AC-1129) - A
ConflatingRecoveryPointAdapterconstructed with aSOWRecoveryPointAdapterwill now properly increment the reference count on theSOWRecoveryPointAdapter. Previously, theSOWRecoveryPointAdaptercould get garbage collected by the Python interpreter leading to a core dump during the next update. (AC-1290) - A
SOWRecoveryPointAdaptercreated 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
MemoryPublishStorewill 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, orsowDeleteByDatafunctions that return aMessagenow 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_SETSIZElimit on fd. (z19441) (AC-1373) - Prevent a deadlock that could occur from an immediate call to
connecton aClientfollowing an exception from callinglogon. (AC-1376)
Version 5.3.4.5 (2025-01-15)
New features:
- Added
http_preflightURI 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 theampsprotocol and AMPS server version 5.3.4.0 or higher. Extra headers may be set on the GET message usingadd_http_preflight_headeroradd_http_preflight_header_key_valuemultiple times. (AC-1284)
Fixes and other changes:
- When executing a
Commandforunsubscribe, the client will now correctly remove any message handlers for the subscription and update theSubscriptionManagerto not restart the subscription. (z18760) (AC-1349) - Failures when creating a
tcpsconnection using Python3 are now correctly passed along in theAMPSException. (z18174) (AC-1347)
Version 5.3.4.4 (2024-12-18)
New features:
MemoryPublishStore,PublishStore, andHybridPublishStorenow 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.SSLContextthat has already been set up in your Python code. The boolstrict_ciphers_onlywill set Python 3.10+ to useDEFAULTciphers ifFalse. (z18174) (AC-1322) AMPS.ssl_get_context()can be called afterAMPS.ssl_init()to get the underlyingssl.SSLContext. (z18174) (AC-1322)AMPS.Clientnow has a methodget_ssl()that returns thessl.SSLSocketof 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
DisconnectedExceptionto be thrown byexecutefor 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
DisconnectedExceptionif the disconnect happens before the command has been sent. This can result in seeing aSubidInUseExceptionif the same command is tried again after theDisconnectedException. (z18574) (AC-1329) - Fixed logic for functions that return
MessageStreamobjects 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
DisconnectedExceptionand not aTimedOutException. (AC-1337) - The
ampsprotocol parser now correctly parses and serializes headers containing characters that must be escaped in JSON. (AC-1342) SOWRecoveryPointAdapterproperly 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
InvalidBookmarkExceptionor 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.reportSuccessis to callServerChooser.reportFailurewith 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_subscribeorsow_and_delta_subscribecommands. (z18075) (AC-1314) - Always use synchronous send with processed ack when executing
Commandfor 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
unsubscribeif 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
UsageExceptionwill be thrown from aSOWRecoverPointAdapterif 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
ConflatingRecoveryPointAdapterwith aDynamicRecoveryPointthat 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
MessageStreamtimeout 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
Messageused for messages going into aStoreis 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=falseto 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
HAClientnow has aset_failed_resubscribe_handlerwhich 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_filterto specify if the transport filter might be used to modify the bytes, such as for testing bad data. (AC-1170) - Added
setErrorOnPublishGapto theStoreinterface and toClient. If this is set, aStoreimplementation 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 usingsyncacknowledgement 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_valuetoClientto 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_subscribeconvenience function to not send the command twice. (AC-1259) (z16250) - Fix a memory leak of a
struct addrinfowhen trying to bind the client connection to local address fails. (AC-1260) - Correct all of
Message.Command.xxxEnumvalues. (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
unsubscribecommand 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_yieldand replaced them with wait/signal pairs. (AC-1208)
Version 5.3.3.3 (2021-07-18)
Fixes and other changes:
- Break up sleeps from
ReconnectDelayStrategyinto 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_byfields onMessage. (AC-1181, AC-1190) - Fix
RecoveryPointclass 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_INFOAand 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
MemorySubscriptionManagerhandling 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_tusing%lxand 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
HAClientif a disconnect happens while the client is executing asow_delete,sow_delete_by_keys, orsow_delete_by_datausing 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::publishFlushnow 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
MessageHandlergarbage 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:
Clientnow releases references toMessageHandlers when they are unsubscribed so they can be garbage collected. (AC-456)Client.executenow properly handles subscriptions with thereplaceoption, leaving the currentMessageStreamas handler for the data instead of creating a new one. (AC-893)- Catch exceptions in
FailedWriteHandleror global command type message handlers and report them to theExceptionListenerif 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
BookmarkStoreimplementations 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_flushwhile other threads are callingpublish. (AC-1009) - Fix race condition in
HAClientwhere 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_publishfunction 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
ReconnectDelayStrategyinHAClient. (AC-1017) - Prevent
ExceptionListenerfrom being called after it is deleted. (AC-1020) - Ids that are automatically generated by the
Clientare 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
bindis now error-checked when applied to tcp sockets. It is a synonym forpathon unix domain sockets. (AC-1029) (AC-1055) - Calls to
HAClient.connect_and_logonwill reset theReconnectDelayStrategybefore 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_logonwithout an explicit call toreseton the delay strategy. (AC-1030) (z12123) - When
unsubscribeis called, the associatedMessageHandlerwill 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
MessageRouterto 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
Clientwhen 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
startTimerandstopTimerfunctions onClientare 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
setGlobalCommandTypeMessageHandlerfunction that is used to put in place handlers for all messages of a specific command type, such asack. AMessageHandlerput 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_callbackthe C library andsetThreadCreatedCallbackto 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
MemoryBookmarkStorecan now be created with aRecoveryPointAdapter. The adapter can be implemented to save aRecoveryPointsomewhere for later recovery to guarantee no missed messages. (AC-527) - A
SOWRecoveryPointAdapterimplementation of theRecoveryPointAdapterinterface have been added. The behavior is to save every update into a SOW topic in the server using a separate client. (AC-756) - A
ConflatingRecoveryPointAdapterimplementation of theRecoveryPointAdapterinterface have been added. The adapter starts a thread that conflates updates before passing them to an underlyingRecoveryPointAdaptersuch as aSOWRecoveryPointAdapterto reduce the number of updates. (AC-965) - Added
setAckTypetoCommandclass 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
NOWbehavior if no bookmarks are found. (z5314) (z9621) (AC-887) - Added
getQueryIdandsetQueryIdtoCommandclass. (AC-927) - Added
getSequenceandsetSequencetoCommandclass. The sequence can be checked after a call toexecutefor commands such aspublish,delta_publish, andsow_deleteto 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_timeoutandset_resubscription_timeoutto theHAClientclass 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
appendmethod onFIXBuilderandNVFIXBuildernow returns the builder object so it can be called repeatedly in a single line. (AC-729)
Fixes and other changes:
- Fix
LoggedBookmarkStoreto 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_LENandAMPS_MAX_SUBID_LENwhich are defined ininclude\Field.hpp. (z9263) (AC-874) - Fix calls to
FailedWriteHandlerto 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
BookmarkStoreif 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
Clientto return an emptyMessageStreamany time aCommandwill not return any messages or acks. Previously, commands such assow_deletethat did not request astatsack could hang if you attempted to iterate the returnedMessageStream. (AC-964) - Destroying a
MessageStreamthat is only going to receiveackmessages 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.executecan 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_functionon aClientthat 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
Clientthat had returned at least one emptyMessageStreamfrom 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
MessageStreamhad a timeout set and the attempt to get the nextMessagetimed out. (AC-949) (z10724) sow_and_delta_subscribewill now properly throw aTimeoutExceptionif theprocessedack 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
processedandpersistedacks were being delivered to the last chance handler. (AC-946)
Version 5.3.0.2 (2019-11-06)
Fixes and other changes:
MessageStreamImpldestruction 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)FixedReconnectDelayStrategyandExponentialReconnectDelayStrategyno 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
MessageStreamobject 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
BookmarkStoreclasses to improve their performance. (AC-391)
New features:
- Added
SelectandExpiretoMessage.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
BlockPublishStoreimplementation 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
RingBookmarkStoreclass 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
ackfor 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
HAClientthat 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
SubscriptionManagerif one is present. (z5943) (AC-709) MessageStreamobjects 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)
MessageStreamobjects produced by aClientwith 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 theMessageStreamwhich 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.prunenow cleans up files that have only accumulated new persisted bookmarks. Previously, only a change in the last discarded bookmark would causepruneto modify the file. (z8434) (AC-831)- Fork handling has been implemented to prevent deadlocks when using multi- processing. (AC-832)
LoggedBookmarkStore.prunewill now retry file delete and rename operations in case of slow file system updates. (z7614) (AC-836)- Added
AMPS.ssl_set_verifyandAMPS.ssl_load_verify_locationsfunctions to enable certificate verification. (AC-839) - Removed potential hang in
HAClientif 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_deletecommands. (z8567) (AC-841) - Fixed incorrect parsing of
ampsprotocol messages containing a topic with a trailing / character. (z8648) (AC-843) - Fixed
sow_and_subscribeto no longer settop_non all queries. This bug first appeared in version 5.2.3.0. (AC-845) - Fixed
BlockPublishStoreto always restore_resizingto 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.logonfunction can now be called with an options string, such as "ack_conflation=500ms" (AC-792). - The
HAClientclass now hassetLogonOptionsandgetLogonOptionsfunctions to set the options to be used forlogoneach time it's called (AC-792). - The
VersionInfoclass 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.hppheader 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
MessageStreamwhere the subscribe family of calls could potentially not send the subscribe command to the server during a reconnect, so theMessageStreamwould always be empty. (AC-787) (z7622) - Fix potential deadlock between the python GIL and the
Clientlock when using bothMessageStreamand aConnectionStateListener. (AC-790) (z7676)
Version 5.2.2.1 (2018-06-12)
Fixes and other changes:
- Fix
Client.unsubscribe(id_)to properly throwDisconnectedExceptionif theClientis disconnected when calling the function. Previously, this could hang. (AC-772) - Fix
Clientto only addMessageHandlers 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
ConnectionStateListenerclass has been expanded to include:LoggedOn,HeartbeatInitiated,PublishReplayed,Resubscribed, andShutdownstates.Shutdownindicates that theClienthas 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 theLoggedOnstate for aClientor theResubscribedstate 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_listenerto specify the version of your listener.Client.ConnectionStateListener.EXTENDED_STATESindicates it expects the int values above. The default, or any version less than that such asClient.ConnectionStateListener.ORIGINAL_VERSIONindicates it expects onlyTrueorFalsefor connected or disconnected (includes SHUTDOWN). - Added
Client.set_default_max_depth,Client.get_default_max_depth,MessageStream.get_max_depth, andMessageStream.get_depthmethods to control the max depth on newMessageStreamobjects created by theClientand 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.ackandMessage.ackmethods to allow passing of an options string, such as "cancel". (AC-726) - Removed possible memory leak of a
MessageStreamwhen 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=truein the URI. (AC-755) - Fixed possible core dump if
HAClientwas destroyed while a thread was still trying to reconnect. (AC-761) - Added missing
Message.is_records_updated_nullmethod. (AC-669)(z5530)
Fixes and other changes:
- Fix
Client.unsubscribeto properly throwDisconnectedExceptionif theClientis disconnected when calling the function. Previously, this could hang. (AC-760) (z6892) - Fix
Client.unsubscribeto properly remove allMessageHandlers in place for subscriptions. (AC-768) - Fix a possible deadlock in
HAClientthat could occur iflogonfails 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 partialMessagefrom 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
MessageRouterclass that could cause improper message routing or even a crash. (Z6536) (AC-748) - Remove a compiler warning in
mmapbookmarkstore.cppintroduced in version 5.2.1.4. (Z6503) (AC-746) - The
HAClientdisconnect 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, andRecordsUpdatedfields were added to theMessageclass. (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
Storeon aClientthat is consuming from an AMPS Queue. Issues included incorrect unpersisted count, incorrect duplicate detection, hangs while trying toflushtheStore, 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
Fieldon aMessage. (AC-714) - Fixed calls to
sowDelete*functions to remove theMessageHandlerif a timeout occurs. (AC-717) - Fixed
MemorySubscriptionManagerto 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:
MMapBookmarkStoreandLoggedBookmarkStore. (AC-683) (Z5652) - Improved
prunefunction forMMapBookmarkStoreandLoggedBookmarkStoreto 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_subscribefunction has been removed fromClientas the AMPS server does not support this operation. (AC-646) - Added
Client.setRetryOnDisconnectmethod 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)
Commandobject 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_Checkwithout 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):
SkipNProjectionGrouping
Fixes and other changes:
- Fix possible core dump from recursive GC involving
ClientandMessageHandlerobjects saved in theClient. (AC-607)
Python version 5.1
Version 5.1.0.0 (2017-01-31)
New features:
- Expose additional methods from
MemoryBookmarkStoreandMMapBookmarkStore. (AC-471)logdiscard_messagediscardget_most_recentis_discardedpersistedpersisted_indexpurgeget_oldest_bookmark_seqno_persisted_acksset_server_version
- Added new function
setResubscriptionTimeouttoMemorySubscriptionManagerclass 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
Clientfor heartbeat interval and read timeout. (Z3720) (AC-508) - Added new options for 5.1.0.0 and newer AMPS servers (AC-532) (AC-543):
ConflationConflationKeyFullyDurableRateMaxGap
- Added new function
purge_sub_idto theBookmarkStoreimplementations. 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.connectAndLogonat the same time. (AC-449) - The
MemorySubscriptionManager.DefaultResubscriptionTimeouthas been changed to 0, or no timeout. (Z3372) (AC-460) - Updated
LoggedBookmarkStore.prunefunction 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
NotEntitledExceptionmessage between logon and other commands. (AC-511) - Fix
MemorySubscriptionManagerto reset state properly if there is an exception during resubscribe. Previously, it could produce a deadlock. (Z3928) (AC-519) - Fix
PublishStoreso 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
PublishStoreto 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
Clientto 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
MessageHandlerfor a subscription ifMemorySubscriptionManageris doing a resubscribe while another thread is updating the same subscription with a replace, pause, or resume. (AC-559) - Fix
FixedDelayStrategyso that a maximum of 0 always means retry indefinitely. (AC-561) - Fix
Clientso that a call toget_unpersisted_countdoes 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
Clientwith aPublishStorecould 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_datato accept data with embedded nulls. (Z3392) - Fix
HAClientto retry connecting ifreportSuccesson theServerChooserthrows an exception. (Z3256) - Fix bug in
Clientthat could cause aLoggedBookmarkStoreorMMapBookmarkStoreto have an incorrect value for most recent for AMPS servers version 4.0.0.0 and above. (AC-447) - Provide the ability to implement
BookmarkStoreandPublishStorein 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.pruneandMMapBookmarkStore.prunethat could result in invalid bookmarks or invalid entries in the store. (Z3165, Z3268) (AC-439)
Version 5.0.0.1 (2016-03-25)
Clientproperly 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)Clientwill now respond to authentication challenges with user id sent by the server in its response. (Z2993)BookmarkStoreimplementations 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
pauseandresumeoptions for bookmark subscriptions, and stores the state of a bookmark subscription in theSubscriptionManagerto 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
NVFIXBuilderandFIXBuilderto stop leaking a pythonStringobject 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
AlreadyConnectedExceptioninstead of aUsageException. (AC-306) - Calling
connecton anHAClientwill now forward the call toconnect_and_logon. (AC-306) - Attempting to call
logonon anHAClientwill throw anExceptionstating to useconnect_and_logon. (AC-306) DefaultServerChoosernow has anadd_allfunction that will take a list of uri strings to be added in order. (AC-361)- Client will invoke the
FailedWriteHandlerfor all failures. Previously it was only invoked for duplicate and not entitled failures. (AC-339) - Added
NoTopicto theReasonclass. - The version sent to AMPS in logon is now
getVersion() + ":python"to aid in debugging. (AC-385) - Added
add_message_handlerandremove_message_handlerfunctions to Client so the non-blocking version ofsendcan be used and results will still be handled. (AC-333) - The
TransmissionTimefield 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
Storeimplementations 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_flushto be a keyword argument rather than just positional. (Z2189) - Fix
MessageStreamswith a timeout set so theMessageStreamwill end iteration for commands that have a defined end point, such as sow queries. Previously,MessageStreamswith a a timeout set would continue to produce invalid messages after receiving thegroup_endfor a sow command or when a stats ack is returned and the ack is the only message expected. - Fix
Client.set_transport_filterto throw an exception instead of crashing when called on a not-connected client. (Z2217) - Changed the
send,executeandexecuteAsyncmethods onClientto return all acks that are set on theCommandobject to theMessageStreamorMessageHandler. 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
Messageand a reason string. Handlers with the old interface should continue to work in this release. PublishStorewill 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)PublishStorehas a new functiontruncate_on_close(boolean), which, if set toTruewill cause an emptyPublishStoreto attempt to truncate its file toinitialSizeblocks when it is closed. (AC-405) (Z2255)- Added
Pause,Resume, andRate()toMessage.Optionsfor buildingCommandoptions strings. (AC-406) - Added support for passing a
Clientto a user-defined C/C++ function through thectypesinterface. (AC-420)
Python version 4.3
Version 4.3.1.5 (2016-12-18)
This version contains the following additions and fixes:
- Fix possible
SEGVduring 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_keyswhen noon_messageparameter is supplied. In versions 3.8.1.x, callingsow_delete_by_keyswith 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
ExponentialDelayStrategyto never exceed the maximum delay, even when using jitter. (Z2190) - Fix
ExponentialDelayStrategyon 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
NVFIXBuilderandFIXBuilderto no longer leak a pythonStringobject when converting appended values from a non-string type. (Z2017) - Fix
SEGVwhen anAMPS.Clientis deleted by the python garbage collector and thatClienthas an exception listener registered where the exception listener has a circular reference to the deletedClient. (Z2090) - Fix
Clientto properly process authenticationretryacks.
Version 4.3.1.1 (2015-07-22)
This version contains the following additions and fixes:
- Prevent possible OOM when a
MessageStreamis 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
SyncSOWDeleteMessageHandlerstate 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
CompositeMessageBuilderandCompositeMessageParserfor working with composite message types. - Added new method
MessageStream.timeout()to set the timeout when calling thenextmethod, or when iterating over a message stream. - Calling
set_heartbeaton anHAClientthat is not connected will no longer throw aDisconnectedException. (Z1570) - Fixed object reference leak when destroying a
ClientorHAClientobject. (Z1613) - Added support for garbage collection and cyclic references to
ClientandHAClient. (Z1627) - Added new class
FixedDelayStrategyandExponentialDelayStrategy, 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
ClientandHAClient. (AC-325, Z1623) - Allow
Noneto 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_listenerandClient.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_subscribemethods where the returned command ID or subscription ID may be incorrect when using aClientfrom 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 anHAClientis 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
Clientno longer causes a crash or hang at exit when aMessageStreamobject 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
HAClientinstance 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
SEGVwhen disconnecting a client, or when shutting down while a client is connected. (AC-283) - Fixed crash that may occur when a
MessageStreamis still receiving messages while the calling program exits. (Z1407) - Changing the
BookmarkStoreorPublishStoreon a connected client raises aUsageException. (Z1407) - Fixed silent failure when calling
FIXBuilder.append()with a non-integer key. This failure sometimes results inTypeErrorbeing 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_handlertoset_last_chance_message_handler. (AC-197) - Renamed
published_duplicate_handlertofailed_write_handler. (AC-280)
This version introduces the following new features and fixes:
- Fixed race condition that leads to an occasional
SEGVwhen disconnecting a client, or when shutting down while a client is connected. (AC-283) - Add new
Commandclass to facilitate more flexible and easier execution of AMPS commands, along withexecuteandexecute_asyncmethods onClientto 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
Commandclass. - Removed 22-character limit from command, subscription, and query IDs (AC222)
- Record
sow_deleteoperations in publish stores so that, during replay,sow_deleteandpublishmessages 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,andOrderByfields 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 newflushcommand on the AMPS server when available. (AC182) - Cause all
sow_deletemethods to request astatsack from the server. - Added support for
orderby,bookmark, andtopNarguments tosow,sow_and_subscribe, andsow_and_delta_subscribe. - Added optional
sub_idparameter 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
Messagenow 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
Storewill 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
PublishStoreno 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
PublishStorecan no longer incorrectly try to resize to very large sizes after replay. This behavior could cause out of memory errors. (AC200) LoggedBookmarkStorewill 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
HAClientconnect_and_logonor when trying to publish while the reader thread is trying to connect inHAClientconnect_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 aMessageStreamwhich 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 ofsubscribecan 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 toClientto return the version of the connected AMPS server. This function returns a numeric value with the pattern:Major Minor Maintenance HotfixTwo 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 toClientto 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
VERSIONstring to AMPS for the client version and fixed version insetup.pyto 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 passingNoneas an expiration value topublishanddelta_publish.
Version 3.8.0.1 (2014-02-24)
- The
Nonekeyword is now accepted for message expiration for bothpublishanddelta_publish. - Publish functions now accept keyword arguments.
- The expiration field in published messages had an unnecessary trailing
NULLbyte. This is no longer sent. - The
sendfunction now ensures thatackTypeand 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_DIRto build the Python client. You can still setAMPS_CPP_DIRif 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_idoptional parameter to various subscribe commands onClientto make it easier to do replace requests and allow them to update the defaultMemorySubscriptionManagerin theHAClient. - Protect against unbounded store growth. Add new
setResizeHandlerfunctions on the publish and bookmark store classes so clients can take action when a store is growing. - Fix bug in reference counting on
ServerChooserwhen 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
ServerChooserreport_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
HAClientconnect_and_logon.
Version 3.2.0.2 (2013-12-11)
- Add new wrappers for
PublishStore,MemoryPublishStore,MMapBookmarkStoreandMemoryBookmarkStore,HybridPublishStore. Add methods forset_publish_storeandset_bookmark_store. - Add a new
HAClientconstructor 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(publishFlushin C++). - Fix for possible crash when multiple clients subscribe within a single application.
- Update
RECENTbookmark toMOST_RECENTto match documentation and other languages.
Version 3.2.0.1 (2013-11-22)
- Add new
HAClient.connectwith a more helpful exception when no argument is passed. - Fix
SEGVthat occurs when an uninitializedHAClientis 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
HAClientfunctionality. - Added
sow_delete_by_keys. - Added
FIXShredder - Reorganized
Exceptionhierarchy to make current exceptions inherit from legacy exceptions.