HISTORY notes for AMPS Java Client
This page provides a list of changes made in each version of AMPS Java Client.
Java version 5.3
Version 5.3.5.0 (2025-09-15)
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 aCommandException
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) - Added missing
copy()
toNVFIXMessage
class. (AC-875) - Adds support for zlib compression when connecting to AMPS. Zlib
compression increases CPU consumption and may reduce network traffic
for some message types. Zlib compression is specified by adding
a
compression=zlib
option to the connection URI. (AC-1035) - Added
setCommandId(String)
andsetQueryId(String)
toCommand
class as analogs to existing versions takingCommandId
. (AC-1264) - Removed unused excption types:
InvalidProtocolException
,InvalidProtocolOptionsException
,InvalidTransportOptionsException
,TransportException
, andPublishFilterException
. (AC-1310)
Fixes and other changes:
- The Client will now do all internal processing of ack messages before delivering the ack to any registered handlers. (AC-766)
- A
StoreException
will be thrown ifnull
is used as the subId for anyBookmarkStore
function. (AC-903) - Removed potential deadlock between
BookmarkStore
implementations andRecoveryPointAdapter
implementations when usingDynamicRecoveryPoint
as theRecoveryPoint
type. (AC-1288) - Fixed logic for functions that return
MessageStream
objects so they aren't closed if the disconnect occurs before the command is sent. (AC-1331) - 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) - 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) BookmarkStore.getMostRecent
now always returns a newField
. This avoids any race conditions where theField
could change in another thread. (AC-1363)- 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) - 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.1 (2025-03-14)
Fixes and Improvements:
- Fix the client's transport to set a socket read timeout of 30 seconds,
by default, during the SSL handshake phase of connection establishment.
Previously, the client's normal socket read timeout wasn't set until
the handshake phase was complete, so if a server handshake response
never arrived, the client would wait indefinitely. When customizing the
TCP connection timeout (which is indefinite by default) using the
tcp_connecttimeout
connection URI parameter, its value will also be used to override the 30 second handshake read timeout. (AC-1359, Z19029) - Fix
amps
protocol serialization and deserialization to properly handle escaping of the options and orderBy message header fields. (AC-1292) - Fix client to send a heartbeat message at the set heartbeat interval (if set), even when no messages are arriving from AMPS. Previously, the client would only send a heartbeat message in response to messages (heartbeats or otherwise) arriving from AMPS. (AC-1305)
- Fixed
MessageStream
hang when rapidly reusing query IDs inClient.execute()
calls with SOW commands. (AC-1309) - Fix binding to a local network interface and port number when
specifying the
bind
connection URI parameter. Previously, binding to a specific interface would work correctly only when specifying a local network interface without the port. Also fix handling of local network interfaces specified by IPv6 addresses with square bracket notation. (AC-1344, Z18681)
Version 5.3.4.0 (2024-04-04)
New features:
-
Fix to make it easier to extend TCP and TCPS Transports (for example, to add proxy negotiation to the connection process). (AC-1058, Z12429)
-
Added a way for clients to be notified and take action when a subscription fails after a fail-over event. The
SubscriptionManager
now has asetFailedResubscribeHandler
which takes an implementation of the new classFailedResubscribeHandler
. (AC-1096) (z12909) -
Added default constructor and
setName
function toClient
and a default constructor toHAClient
for use in frameworks that require default constructors. The name can only be set once and changing the name once it is set will throw an exception. (AC-1184) (z14094) -
Added
setErrorOnPublishGap
to theStore
interface. 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) -
AMPS Java Client now supports MacOS on arm64 and x86_64. (AC-1200)
-
AMPS Java Client now supports Linux on arm64.
-
Added
tcp_idlereadtimeout
URI parameter to set read timeout between 1 and 1000ms. Also addedgetIdleRunnable
to theTransport
interface. This allows for setting tasks to be run by the reader thread when the socket is idle and chaining new tasks with previous ones. (AC-1282) -
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 using
addHttpPreflightHeader
multiple times orsetHttpPreflightHeaders
once with the list of headers as strings. (AC-1284) -
Added
initFromClient
toTransport
interface to ease introduction of new transport-related features that are easier to set on theClient
. The function is called byClient
whenever it has a newTransport
. -
Added getters for transport filter and thread created handler to the
Client
.
Fixes and Improvements:
- Rethrow
CommandException
as aConnectionException
fromlogon
so that logon failures such as invalid message type are correctly seen. (AC-1122) - Fix possible locking issues in
MessageStream
to prevent invalid concurrent access if the stream is conflating messages (that is, if client side confaltion is in use). (AC-1186) - Changed publish store classes to throw a
StoreException
if they attempt to resize beyond maximum array size, rather thanNegativeArraySizeException
orIllegalArgumentException
. (AC-1201) (z14395) - The ack timeout on the
Client
no longer allows 0, or no timeout, when the ack batch size is greater than 1. This prevents any partial batches from never being sent to the server, leaving the queue messages as processed by the client but unacknowledged. (AC-1206) - Change field escaping to include command id and query id on inbound messages, include query id on outbound, and not include command or top_n on outbound messages. (AC-1215)
- Fixed possible hang or missed acks when a disconnect occurred while sending
sow_delete
commands. (z8567) (AC-1220) - Remove default setting of
so_linger
on new connections. (AC-1255) - Documentation has been expanded to cover some previously missed items and improve clarity. (AC-1257)
- Prevent any commands from being sent to the server while waiting for the logon ack and ensure no duplication with commands that are sent as part of the overall logon process such as heartbeat commands. (AC-1262)
- Prevent bookmark stores from returning a list of bookmarks beginning with
EPOCH
in cases where: messages have been logged from the server, messages other than the very first one have been discarded, and at least one persisted ack has arrived from the server. (AC-1266) (z16462) (z16700) - If an attempt is made to change the protocol or transport type that a
Client
is using, aConnectionException
will be thrown with a clear error stating what has changed. Previously, the connection could fail without any clear message on the client side. (AC-1275) TimedOutException
on the client side will now send anunsubscribe
to the server to prevent the timed out command from eventually succeeding and returning data the client is no longer expecting. (AC-1281)SOWRecoveryPointAdapter
will now throwStoreException
from its constructor in the case where thetrackedClientName
matches the name of theClient
being used to write to the SOW. This was previously allowed, though documented not to work. (AC-1285)- Fix a potential deadlock that can occur when one thread calls disconnect on the client while the reader thread is performing an interruptable task for which an InterruptedException is caught and not rethrown. This could cause a situation where the thread calling disconnect is waiting for the reader thread to shut itself down and the reader thread is trying to acquire a lock to handle closing the connection. (AC-1286) (z16884)
Version 5.3.3.6 (2023-12-01)
Fixes and Improvements:
-
Fix regression introduced in the 5.3.2.0 Java client, where executing a historical SOW query throws a
NullPointerException
when the command's subscription id field is null. (Z16339) (AC-1263) -
Allow setting a TLS server name indication (SNI) via a connection URI parameter. (Z16460) (AC-1235)
-
Allow setting a TCP connection timeout via a connection URI parameter. (Z16460) (AC-1267)
-
Fix hang in publish stores that may occur when attempting to replay a single message by its sequence number (such as when the HAClient is reconnecting) and:
-
An acknowledgement arrives for that message at the same time, or
-
An exception is concurrently thrown while attempting to store that message.
(Z16043) (AC-1248)
-
-
Fix deadlock that can occur when publishing on an
HAClient
with a publish store registered, where:-
The client has never connected, and
-
The
connectAndLogon()
method is called for the first time.
(Z15888) (AC-1253)
-
-
Fix deadlock that can occur when calling
HAClient.connectAndLogon()
more than once without first disconnecting (viadisconnect()
or its synonymclose()
) and then, when the method is called, the client happens to be reconnecting at the same time.This invalid practice has been corrected to throw
AlreadyConnectedException
on subsequent calls made without first callingdisconnect()
.In addition, a regression introduced in the 5.0.1.1 Java client has been corrected such that subsequent calls to
Client.connect()
, without first disconnecting, once again throwAlreadyConnectedException
instead ofConnectionRefusedException
. (Z16172) (AC-1258)
Version 5.3.3.5 (2023-03-16)
Fixes and Improvements:
-
Fix LoggedBookmarkStore handling of discarded bookmarks after recovery to ensure that all duplicates are recognized. Previously, if an application discarded messages out of order, it was possible to deliver a previously discarded bookmark in the following sequence of events:
-
At least one message from a given publisher has not been discarded but a later message from the same publisher has been discarded
-
The application discards an undiscarded message from a publisher before later messages from the same publisher (that were previously discarded) arrive from AMPS
In this case, previously discarded messages from that publisher could fail to be detected as duplicates and could be delivered to the subscription. Messages from other publishers are not affected.
Applications that discard messages in the order that they are received are unaffected. (AC-1224) (z15470)
-
Version 5.3.3.4 (2023-02-10)
Fixes and Improvements:
- Fix regression introduced in AMPS Java client 5.3.2.0 where the
BookmarkField.isTimestamp()
method would require the trailingZ
time zone indicator on a timestamp value. The AMPS User Guide documents theZ
time zone indicator as optional (Z
is assumed). AMPS also accepts timestamps without theZ
time zone specified. (Z15340) (AC-1218)
Version 5.3.3.3 (2022-05-09)
Fixes and Improvements:
-
Fix issue when parsing message headers from a connection to a Transport that uses the legacy
xml
protocol for communication with AMPS that could result in header values remaining unset. With this issue, parsing would stop prematurely when the<TopicMatches>
header was reached, causing the TopicMatches field and any following fields to remain unset. With this fix, all headers are properly parsed. Connections using theamps
protocol (or the other legacy protocols) were not affected. (Z14156) (AC-1178) -
Fix issue where test dependencies were listed in the released POM file of the AMPS Java client Maven package. With this fix the POM file no longer lists dependencies for unreleased tests. (Z14107) (AC-1174)
Version 5.3.3.2 (2022-03-25)
Fixes and Improvements:
-
Fix issue where an unnecessary
Field
object would be allocated while receiving messages for a subscription. This object is no longer allocated. (Z14049) (AC-1167) -
Fix Javadoc warnings in the documentation comments for
MessageStream.setSubscription()
andAckTypeField.decodeAckType()
(Z14040) (AC-1171)
Version 5.3.3.1 (2022-02-21)
Fixes and Improvements:
-
Fix issue in
TCPTransportImpl
where a runtime exception thrown by the transport's registered exception listener callback can cause the client to stop reconnecting or cause the client's background reader thread to terminate. (Z13741) (AC-1152) -
Fix issue where the sequence number assigned to a published message by the publish store, was not made available via
Command.getClientSequenceNumber()
when an exception (such asDisconnectedException
) was thrown during publish command execution. (Z13741) (AC-1154) -
Fix issue where
LoggedBookmarkStore
would ignore a timestamp bookmark value from aRecoveryPointAdapter
upon recovery, such as theSOWRecoveryPointAdapter
with theuseTimestamp
parameter set to true. TheLoggedBookmarkStore
would incorrectly use the bookmark log file creation time as the recovery timestamp, even if the file was newly created during recovery. (Z13710, AC-1156) -
Fix deadlock that can occur during reconnect if another disconnect is detected before the reconnect completes. This can only happen when a zero (unlimited) timeout is being used for logon or resubscribe. (Z13588) (AC-1147)
-
Fix issue in
MemoryBookmarkStore
that causes a malformed most recent bookmark to be returned during recovery when it's used with aSOWRecoveryPointAdapter
that makes use of the recovery timestamp feature (i.e.useTimestamp_
is true). (Z13551) (AC-1148) -
If a list of bookmarks is provided to
client.ack(topic, bookmark)
and ack batching is on, parse the list so correctly sized batches are sent. In all cases, ensure that byte[] resizes are large enough to hold the entire new bookmark value. (Z13301) (AC-1130) -
Fix regression where duplicate reason code strings were introduced into
ReasonField
in version 5.3.3.0. This can cause an incorrect error message to be displayed when converting some reason codes from a failure acknowledgement into a string. (AC-1126) -
Fix
persisted
ack processing inLoggedBookmarkStore
andMemoryBookmarkStore
, where sequence number comparisons where being treated as signed long integers instead of unsigned long integers. This could lead to incorrect processing for very large sequence numbers. (AC-1109)
Version 5.3.3.0 (2021-09-03)
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
adds a new overload that accepts an ack type to request. This argument accepts an ack type ofprocessed
or an ack type ofpersisted
. When the argument is specified, the client will always send aflush
command to the server, regardless of whether aStore
is present. If aStore
is present, the command will also wait for all messages currently in the publish store to be acknowledged before returning. With an ack type specified:-
A
processed
acknowledgement requests that AMPS acknowledge that theflush
command has been received and processed. -
A
persisted
acknowledgement requests that AMPS acknowledge that theflush
command has been received and processed and that all previous messages have been persisted.
There are no changes in behavior to the existing version of the
Client.publishFlush
method. (AC-1046) -
Fixes and Improvements:
-
Persisted acks with a failure status for bookmark subscriptions will no longer be delivered to the
FailedWriteHandler
when there is no publish store in place on the Client. (z4702) (AC-627) -
Fix issue where
RingBookmarkStore
didn't properly recover when used with a bookmark range. (AC-1112) -
Fix handling of bookmark lists and bookmark ranges starting with bookmark lists in
LoggedBookmarkStore
andMemoryBookmarkStore
. (AC-1112) -
Fix issue in
MessageStream
where closing it may not remove all references to theMessageStream
as aMessageHandler
when the sub_id differs from the associated command_id and an ack was explicitly requested. (AC-1112)
Version 5.3.2.1 (2021-07-16)
Fixes and other changes:
- Fix JavaDoc warnings and errors when compiling with Java 1.8. These errors and warnings had no effect at runtime. This fix allows the client to compile from source when the compiler is is set to fail the build on any warning or error. (Z12969) (Z13004) (AC-1100)
Version 5.3.2.0 (2021-06-09)
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) - 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) MessageStream
will now deliver all queued messages before throwing aDisconnectedException
once a disconnect has been detected. (AC-985)- The
ExceptionListener
set on aClient
will now also be set on itsTransport
by default. TheTransport
can be updated with its ownExceptionListener
after theClient
is connected. (z11871) (AC-1011) Client.deltaPublish
now returns the sequence number, if one was set, similar toClient.publish
. (AC-1016)
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 whether that message is also handled elsewhere. (z3407) (AC-450) (AC-565) (AC-658) (AC-675) - Added
Client.setThreadCreatedHandler
and newThreadCreatedHandler
interface. Each time a new client background thread is created, the handler will be invoked by the created thread before it starts receiving messages. This can be used to do things like set the name of the thread or other thread attributes. (z9855) (z9764) (AC-516) (AC-907) - A
MemoryBookmarkStore
orLoggedBookmarkStore
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) (AC-981) - The Client now has a
setTransportFilter
method that will set theTransportFilter
on anyTransport
created by the Client. This can be set before connecting. (AC-657) (AC-1057) - A
SOWRecoveryPointAdapter
implementation of theRecoveryPointAdapter
interface has been added. The behavior of this adapter is to save every update into an AMPS SOW topic in the server using a separate client. (AC-756) (AC-980) - The client name hash, used by the AMPS server, is now accesible using
Client.getNameHash
after the client has logged on to AMPS. (AC-905) - 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)
- Made
getSequence
public on theCommand
class. The sequence can be checked after a call toexecute
for commands such aspublish
,delta_publish
, andsow_delete
to get the sequence number that was assigned by the publish store (if a publish store is present). (z11000) (AC-954) - 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) LoggedBookmarkStore
will now allow subid and bookmark lengths greater than 255 characters. The limit is now Integer.MAX_VALUE. This changes the file format of the store file. The client will automatically update files in the previous format. (AC-998)- Ids that are automatically generated by the
Client
are now prefixed with "auto" to prevent unintentional clashes with user-specified, numeric ids. (AC-1027) - Classes with
close
functions now implementAutoCloseable
interface. This includes:Client
,HAClient
,MessageStream
, allBookmarkStore
implementations, allRecoveryPointAdapter
implementations, allStore
implementations, and allTransport
implementations. (AC-1083)
Fixes and other changes:
- Fix
Message.copy
to only copy the used portion of the buffer rather than the entire buffer. (z2320) (AC-396) - Improved
LoggedBookmarkStore
file recovery such that theIOException
thrown if corruption is found now includes the line number and the file name. (z9263) (AC-874) - If a failed persisted ack returned by the server contains a sequence
number and the
Client
does not have a publish store, the sequence number will be set on theMessage
sent to theFailedWriteHandler
. (AC-884) - Fix issue in
LoggedBookmarkStore
where discarding messages out of order, then failing over, receiving more messages, and failing over again could cause an incorrect most recent bookmark. (z10507) (AC-953) - Ensure that
Client.execute
called with aCommand
not returning any data returns an emptyMessageStream
. (AC-964) - Ensure that message handlers are removed when a command sent to AMPS fails. (AC-982) (AC-983)
- Fix
HAClient.connectAndLogon
to not allow any commands to be sent between connect and logon. (AC-1015) - Fix
HAClient.connectAndLogon
to reset theReconnectDelayStrategy
when called to allow a new attempt after theReconnectDelayStrategy
had previously timed out. (AC-1030) - Fix
Client
andHAClient
to setBookmarkStore
,DisconnectHandler
,ReconnectDelayStrategy
, andSubscriptionManager
to default versions if a null is passed in to the set function. (z12237) (AC-1040) - Fix src distribution to have correct values in
ClientVersion.java
where previously there were placeholders. (z12331) (AC-1041) - Fix
BookmarkStore
implementations to return copies of the most recent field. (z12476) (AC-1060) - Fix
Client.syncAckProcessing
to include the topic name when throwingInvalidTopicException
(z12624) (AC-1076) - Update
BlockPublishStore
to no longer check if a resize is greater thanInteger.MAX_VALUE
and rely on either thePublishStoreResizeHandler
(or the system running out of memory) to manage the maximum store size. (z12668) (AC-1077) - Fix
MessageStream
to remove its message handler when it is notified that theClient
is disonnected. (AC-1079) - Fix
Client.publishFlush(0)
andBlockPublishStore.flush(0)
to act as if there is no timeout, rather than an immediate timeout. (AC-1085) - Fix issue in synchronous command execution where a non-functioning
MessageStream
could be returned when a command is executed on a client that is disconnected and trying to reconnect. (z12590) (AC-1090) - Fix
HAClient
race where its disconnect handler could reconnect a disconnected client afterclose()
ordisconnect()
is called. (AC-1092)
Version 5.3.0.4 (2020-07-22)
Fixes and other changes:
- Fix invalid state that can occur in a bookmark store ring buffer when
a resize operation executes after a call to
getMostRecent(subId)
for a bookmark subscription where messages aren't being immediately discarded or out of order discarding is being used. AgetMostRecent(subId)
call occurs at the start ofMOST_RECENT
bookmark subscriptions and when resubscribing after a disconnect/reconnect cycle, such as failing-over between AMPS servers. The invalid ring buffer state can lead to a hang when discarding the subscription's last undiscarded message. (Z11270) (AC-978)
Version 5.3.0.3 (2020-06-19)
Fixes and other changes:
- Fix publisher hang that occurs after a publish store resize operation when using a custom resize handler, in cases where the custom resize handler throws an exception or where space has become free while the resize handler was running (for example, if a persisted ack from the server arrived). (Z11270) (AC-971)
Version 5.3.0.1 (2019-10-29)
Fixes and other changes:
- Fix issue where persisted acks delivered on a bookmark subscription could be
logged into the client's bookmark store after the subscription has been
unsubscribed (but before the client is closed/disconnected). This could cause
the subscription to "skip ahead" in the transaction log (ahead of the expected
resume point) when later resubscribing the subscription at the
MOST_RECENT
bookmark. This can only happen if the client side of the subscription has not caught up to the server, such that there are content messages "in flight" (on the wire or waiting in a TCP buffer) and the application has discarded all messages received so far through the subscription's message handler. (Z10045) (AC-912) - Fix issue with
LoggedBookmarkStore.log()
where a concurrently executed call toLoggedBookmarkStore.prune()
could cause the concurrent logged bookmark entry (b
entry) to be lost from the pruned bookmark log file (though not lost from in-memory state). If the application then discards this message and shuts down, and later recovers the bookmark subscription from this file, this last discarded message will be redelivered as a duplicate. NOTE: Since the in-memory state is still correct, a subsequent call toprune()
would correct the bookmark log file. Any application that follows the best practice of pruning the bookmark store during shutdown, after the client is closed/disconnected, would likely never observe this issue. (AC-913)
Version 5.3.0.0 (2019-07-31)
New features:
- Added
Select
andExpire
toMessage.Options
. (AC-882) - Added an optional
boolean
parameter toLoggedBookmarkStore
constructor that indicates if the store should include its file's last modified timestamp in its most recent bookmark. This is useful for applications that may be offline long enough that their most recent bookmarks are no longer in the transaction log of the server, but which do not want AMPS to start the subscription fromNOW
(which is the default if the bookmarks are all unknown to AMPS). Including the last modification time of the bookmark store in the recovery string ensures that AMPS will start at the modification time if none of the bookmarks provided are still present in the journal, which will cause the replay to begin at the earliest mesasge in the transaction log rather than at the current point in time (NOW
). (z5314) (z9621) (AC-887)
Breaking changes:
- The
Client.flush
function has been markedDeprecated
. It had no functionality previously. The methodClient.publishFlush
is provided to wait for persisted acks onpublish
andsow_delete
commands if theClient
has aStore
or will wait for aflush
command to be acknowledged asprocessed
ensuring all messages have reached the server. (AC-833) - The default batch size for all sow queries has been changed to 10. (AC-700)
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) 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, AC-897)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)LoggedBookmarkStore.prune
will now retry file delete and rename operations in case of slow file system updates. (z7614) (AC-836)LoggedBookmarkStore.purge
will throw aStoreException
rather than aNullPointerException
if the store was previously closed. (AC-877)- Fixed a deadlock condition during
connectAndLogon
when a client is disconnected before sending the initial heartbeat. (AC-885) (z9590)
Java version 5.2
Version 5.2.3.5 (2019-04-26)
Fixes and other changes:
- Fix issue in
LoggedBookmarkStore.prune()
that could corrupt the bookmark store state of a subscription when there are two or more subscriptions in the store. (Z9263) (AC-876) - Improved
LoggedBookmarkStore
file recovery such that anIOException
is thrown when a corrupted entry is detected in the middle of the file. Previously this exception was intentionally suppressed and the file append position was set to the last known good position in the file. This behavior is still preserved if corruption is detected on the file's last line because a truncated entry can be expected if an application process abruptly exits. (Z9263) (AC-874)
Version 5.2.3.4 (2019-01-25)
Fixes and other changes:
- Fix race condition that leads to a hang while resizing a publish store when using it with a custom resize handler. (Z8769) (AC-853)
Version 5.2.3.3 (2019-01-10)
Fixes and other changes:
- Fix issue where the two-argument
logon()
convenience method doesn't pass itsAuthenticator
to thelogon()
implementation causing client authetication to fail. (Z8747) (AC-830)
Version 5.2.3.2 (2018-12-18)
Fixes and other changes:
- Fix delay when reading large messages in large batches (approaching 200 MB)
from a SOW query. This issue was caused by the JVM implementation of
ByteBuffer.compact()
performing unnecessary array copies. (Z8609) (AC-842)
Version 5.2.3.1 (2018-12-02)
Fixes and other changes:
- The
HAClient
will no longer try to flush batched ack messages for a server queue during reconnect (AC-690). - The
HAClient
can no longer hang during the reconnect process due to flushing ack messages for a server queue during reconnect (z8539) (AC-840). - The
LoggedBookmarkStore.prune
function will now prune the file ifpersisted
acks have been received and no messages discarded (z8434) (AC-831).
Version 5.2.3.0 (2018-08-21)
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.getServerVersionInfo()
returns the new type (z7665) (AC-789).
Fixes and other changes:
- The ack timeout set on a
Client
could fire inconsistently if no messages were arriving (z7427) (AC-795).
Version 5.2.2.1 (2018-07-26)
Fixes and other changes:
- Clients consuming from a queue with an ack batch size > 1 and an ack batch
timeout set previously could fail to send the acks on the timeout interval
if no messages were being sent to the
Client
. (AC-795) (z7427)
Version 5.2.2.0 (2018-04-24)
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
Client.setDefaultMaxDepth
,Client.getDefaultMaxDepth
,MessageStream.getMaxDepth
, andMessageStream.getDepth
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) - Added ability to use pretty printing of binary message types as the data
format by specifying
?pretty=true
in the URI. (AC-755)
Fixes and other changes:
- The client version is now additionally stored as a hard-coded value outside of the manifest for use when the client jar is rebuilt or combined into another jar and the manifest value is no longer available. (AC-754) (z5559)
- 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) - It is no longer possible for a handler to be incorrectly replaced in the
Client
when doing apause
orresume
on an existing subscription. (AC-773) - The client version long form is now sent to the server during logon and
returned from
Client.getVersion()
. (AC-775)
Version 5.2.1.4 (2017-12-27)
Fixes and other changes:
BlockPublishStore.store()
now properly reclaims memory used and prevents the partialMessage
from being replayed. (AC-734)- Fixed a regression in
MemorySubscriptionMananger
since version 5.1.0.0 where the batch size was not saved withsow_and_subscribe
requests, causing them to always be resubscribed with batch size1
. (Z6540) (AC-745)
Version 5.2.1.3 (2017-12-18)
Fixes and other changes:
LoggedBookmarkStore
now correctly prunes its file when called after messages have been discarded. (Z6453) (AC-738)- The
ack()
methods onMessage
andClient
are now a no-op if there is no bookmark provided. Also, the_client
field onMessage
is no longer set on non-queue messages. (AC-733, AC-737) - The
Client.getVersionAsInt()
function now treats any portion of a version that is larger than 99 as 99. (AC-730)
Version 5.2.1.2 (2017-12-06)
Fixes and other changes:
- 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
, large memory growth of theStore
, and queue acks not being replayed from theStore
during recovery. (AC-707) (AC-708) (AC-711) (AC-712) - Fix issue where a failing subscription could be saved in the subscription manager, which could result in persistent failures when reconnecting to AMPS and recovering subscriptions. (AC-709)
- Add getter methods for the current resubscription timeout and
the default resubscription timeout on the
MemorySubscriptionManager
. (AC-695)
Version 5.2.1.1 (2017-10-24)
Fixes and other changes:
- Fix issue where a bookmark subscription on a specific bookmark could be disconnected before receiving any messages and would then resubscribe using EPOCH upon reconnecting. (Z6008) (AC-703)
- Fix
LoggedBookmarkStore
recovery for cases where a bookmark subscription never discarded a message and never received a persisted ack, possibly because a synchronous replication link is down and hasn't been downgraded to asynchronous. (AC-705) - Improved
LoggedBookmarkStore
prune operation so that it leaves the bookmark log file untouched if message discard state hasn't changed. (AC-684)
Version 5.2.1.0 (2017-06-14)
New features:
- The
bookmarkDeltaSubscribe
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 due to disconnection. (AC-635)
Fixes and other changes:
Command
object reuse will no longer cause unrequested acks to be delivered to the message handler. (AC-645)- Fixed extremely rare race condition in
BlockPublishStore
that could cause a client application to hang indefinitely while publishing from multiple threads. (Z5108) (AC-659)
Version 5.2.0.2 (2017-05-08)
Fixes and other changes:
- Fix
LoggedBookmarkStore
to prevent a possible slow recovery when the bookmark log file contains many undiscarded entries, usually after it has been pruned. (Z4974) (AC-647)
Version 5.2.0.1 (2017-03-06)
Fixes and other changes:
- Fix
BookmarkRingBuffer
to prevent possible corruption when aLoggedBookmarkStore
is recovered, and the file contains undiscarded messages. This problem was reported with large numbers of undiscarded messages (> 20K). (Z4447) (AC-612)
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
OptionsField
to correctly use position when removing trailing comma from options string. (AC-602)
Java version 5.1
Version 5.1.0.1 (2017-02-02)
Fixes and other changes:
- Fix
BookmarkRingBuffer
to prevent possible null pointer exception when messages in aLoggedBookmarkStore
are not discarded during multiple recoveries from the file. (Z4447) (AC-603)
Version 5.1.0.0 (2016-12-29)
Breaking changes:
- Added
throws Exception
specifier toreportFailure
inServerChooser
andDefaultServerChooser
to allow implementations to give up when a failure is reported. (Z3372) (AC-448) - Support for Java 6 has been removed. (AC-464)
New features:
- 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(subId)
to theBookmarkStore
interface and all implementations. This function will completely remove all records for the given subscription id from the store. (Z4087) (AC-540)
Fixes and other changes:
- Fix bookmark store classes so a lock is not held while the resize handler is called. This allows other threads to discard messages. (AC-444)
- Reduce memory footprint associated with each distinct subscription when
using
HAClient
and/or theMemorySubscriptionManager
. (AC-469) - 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) - Ensure that bookmark store classes checks for duplicate messages uses
unsigned values when values are larger than
Long.MAX_VALUE
. (AC-529)
Java version 5.0
Version 5.0.1.6 (2016-11-29)
Fixes and other changes:
- Fix issue in LoggedBookmarkStore where calling prune() could lead to a deadlock if another thread simultaneously called log(), discard(), or persisted() on the same store. (Z4212) (AC-548)
Version 5.0.1.5 (2016-11-28)
Fixes and other changes:
- Fix issue that causes a MessageStream object to be leaked when an operation throws an exception (for example, due to timing out) before the MessageStream is returned to the caller. (Z4107) (AC-544)
Version 5.0.1.4 (2016-10-04)
Fixes and other changes:
- Fix issue that could cause a deadlock in the MemorySubscriptionManager when an exception occurred during resubscription after a disconnect at the same time a new subscription was being recorded. (Z3928) (AC-519)
Version 5.0.1.3 (2016-08-10)
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 bug where a
Client
with a publish store could have its publish messages seen as duplicates by the server if the client was also acking messages from a queue. (Z3609) (AC-490) - Fix bug in
Client
that could cause aLoggedBookmarkStore
to have an incorrect value for most recent for AMPS servers version 4.0.0.0 and above in cases where the bookmark store has been written with only persisted acks. (AC-447)
Version 5.0.1.2 (2016-05-12)
Fixes and other changes:
- Fix bug in
BookmarkRingBuffer
where the ring buffer would continue calling theResizeHandler
if the buffer had been completely emptied by the call and theResizeHandler
returns false.
Version 5.0.1.1 (2016-05-09)
Fixes and other changes:
- Fix problem in
CompositeMessageParser
that could cause an exception to be thrown when parsing large messages. (Z3312)
Version 5.0.1.0 (2016-05-03)
Additional functionality:
- 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
FailedWriteHandlerV4Compat
to correctly handle the case where an error ack does not contain a sequence number. (Z3245) (AC-438) - Fix
Client
to add both command id and sub id to theMessageRouter
when acks are requested on aCommand
and those ids are different. (Z3210) - Fix bug in
LoggedBookmarkStore.prune()
that could result in an invalid bookmarks in the store. (Z3165, Z3268) (AC-439)
Version 5.0.0.1 (2016-03-31):
Fixes and other changes:
- Fix publish store so that an empty publish store connecting to a server will properly assign sequence numbers after receiving a sequence number in the logon acknowledgement. (Z3122)
- Fix publish store to properly calculate the CRC value for entries when used by multiple threads.
- Fix
HybridPublishStore
to ensure messages are not missed during replay if there is a simultaneous write to the store that causes the store to move messages from memory to the file. Client.getVersion
now only looks foramps_client
instead of the full jar file name to provide the correct version when the client is packaged in a jar file with a different name.
Version 5.0.0.0 (2016-03-01):
Breaking changes:
- Removed
AMPS_1
andAMPS_2
constants fromClient.Version
. This client does not support AMPS versions 1.x or 2.x. - Removed the
isV1
parameter from the constructor ofFIXMessage
. - Client will now respond to authentication challenges with user id sent by the server in its response. (Z2993)
- Removed the following deprecated fields from
Message
(AC-294):- MaxMessages
- MessageId
- SendEmpties
- SendMatchingIds
- SendOOF
New features:
- This release adds support for AMPS message queue functionality, including convenience functions for acknowledging messages and support for automatic acknowledgement. See the Developer Guide for details.
MessageStream
now supports client side conflation. When enabled, client side conflation replaces unprocessed messages with the sameSowKey
in the queue underlying the message stream.- Added
NoTopic
toMessage.Reason
. - The version sent to AMPS in logon is now
getVersion() + ":java"
to aid in debugging. (AC-385) - Added
addMessageHandler
andremoveMessageHandler
functions toClient
so the non-blocking version ofsend
can be used and results will still be handled. (AC-333) - Added
is___Null()
methods toMessage
for every header field. (AC-107) - Store implementations now store ack type in addition to all previously
saved values.
PublishStore
andHybridPublishStore
have a new file format and will not work with store files from previous versions. - Store interface now only contains one
store()
method which accepts aMessage
. - Store classes now must determine and set the sequence number on
Message
objects that saved. This makes sequencing easier. Store.Buffer
interface now has functions to put a byte array with an offset and a length and to get directly into a Field given a length.StoreReplayer
interface now only contains oneexecute()
method which accepts aMessage
.- Removed interfaces
StoreEx
,StoreWithKeys
, andStoreReplayerWithKeys
. FailedWriteHandler
interface now only contains oneexecute()
method which accepts aMessage
and areason
.FailedWriteHandlerV4
interface is the new name for the oldFailedWriteHandler
interface. To continue using an existingFailedWriteHandler
with no changes to the implementation, change the base class toFailedWriteHandlerV4
.PublishStore
will recover up to corrupt messages, then clear corrupt data before throwing an exception so that the store and its file are recoverable. (AC-404) (Z2458)PublishStore
has a new functiontruncateOnClose(boolean)
, which, if set to true 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) MemoryPublishStore
has been upgraded to handle proper sending of pause and resume subscriptions, making sure that resume groups resume together.
Fixes and other changes:
- Changed accessibility of
CommandId.CommandId(byte[])
andCommandId.CommandId(byte[],int,int)
to public. (Z1643) - Removed
next()
method from ServerChooser interface. (AC-114) - Changed default encoding of
Field
to UTF-8. (AC-304) - Greater consistency in calling user supplied exception listener instead of silently "swallowing up" internal Exceptions. (AC-301)
- Call
discardUpTo
on the publish store when AMPS returns a persisted ack indicating that the message is either a duplicate or the publisher is not entitled. (Z1640) (AC-329) - Added
SowKey
field toCommand
andMessage
classes for publishing to a SOW topic that is externally keyed. AddedStoreWithKeys
interface that takes aMessage
. (AC-337) - A message stored in the publish store won't attempt to be resent after a reconnect because the store should have already replayed it. (AC-328)
- Added get/set LogonCorrelationData to
Client
to provide a base64 field that can be used as additional correlation information about a client after it logs onto AMPS. (Z1539) (AC-311) - Added
Timestamp
,NoSowKey
, andCancel
toMessage.Options
for buildingCommand
options strings. (Z1669) (AC-356) - Removed unused exception from
HybridPublishStore(string, int)
constructor. (Z1999) - Throw an
AlreadyConnectedException
when attempting to set a publish or bookmark store on a client that is already connected as this is undefined behavior. (AC-306) - Throw an
AlreadyConnectedException
orDisconnectedException
when attempting to call logon on anHAClient
which does connect and logon as a single operation. (AC-306) - The
FailedWriteHandler
will now be called in all cases of a persisted ack being returned for a failure. If there is aPublishStore
in place, the saved message will provide the data. Without aPublishStore
, only the sequence number, if there is one, and the reason will be provided to the handler. (AC-339) - Fixed
Message._copyTo
to properly copy the original Message when the original doesn't have an underlying buffer with the entireMessage
. SubscriptionManager
interface now takes aMessage
in the subscribe function instead specific fields. (AC-336)- Fixed
ExponentialDelayStrategy
to never return a delay larger than the maximum delay set on the strategy. (Z2190) - Fixed
BookmarkStore
classes to correctly serialize publisher id and sequence as unsigned long values. (Z2052) - Changed
Client.execute
function to work better withpublish
anddelta_publish
commands. If no acks are requested, an emptyMessageStream
is returned. If acks are requested, a command id is added before the message is sent. (AC-300) - Changed
Client.execute
andClient.executeAsync
to return all acks that are set on theCommand
object to theMessageStream
ofMessageHandler
. Previously, acks that are used internally in theClient
(for example, processed acks) were blocked from being returned. (AC-332) - Allow custom processing of hearbeat messages through the last-chance message handler. (Z2340)
- Add new, optional "maximum" parameter to
FixedDelayStrategy
. (Z2030) - Throw
DisconnectedException
when executing commands on a client that is not currently connected. (Z2503) Command.prepare()
is now permitted to throwAMPSException
. (Z2503)Client.allocateMessage()
is now permitted to throwDisconnectedException
. (Z2503)- Fix to correctly set
subId
forMessageStream
. (Z2528) - 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)
- No longer spin while waiting for a
connect()
to finish. (Z2932)
Java version 4.3
Version 4.3.3.0 (2016-08-05)
Breaking changes:
- Added throws Exception specifier to reportFailure in ServerChooser and DefaultServerChooser to allow implementations to give up when a failure is reported. (Z3372) (AC-448)
New features:
- Added new function setResubscriptionTimeout to MemorySubscriptionManager class to change a non-static value used for timeouts during resubscription. Previously, there was only a single static value. (Z3372) (AC-461)
Fixes and other changes:
- Fix bug in LoggedBookmarkStore with server versions 3.8.0.0 - 3.9.X where the internal file handle could be left open and cause prune to fail when replacing the file. (Z3428) (AC-459)
- Changed MemorySubscriptionManager default timeout to 0. A bug was introduced in 4.0.0.0 that caused MemorySubscriptionManager to ignore the default timeout and use 0. The bug in 4.0.0.0 was fixed in 4.3.1.9 incidental to another fix, which caused a behavioral change from 4.0.0.0. This release reverts to the 4.0.0.0 default timeout behavior. (Z3372) (AC-460)
- HAClient.connectAndLogon is now thread safe to prevent the possibility of a deadlock. (Z3372) (AC-449)
- Fix bug in Client where sowDelete commands executed with a publish store in place were not requesting a persisted ack, which could cause the store to never be empty if sow_delete was the last command in the store. (AC-480)
- Fix bug in Client where a deadlock could occur between the Client receive thread and a send thread in rare cases where both threads detect a disconnect at the same time.
Version 4.3.1.10 (2016-05-11)
Fixes and other changes:
- Fixed Client to register the message handler for a Command for all acks that are requested. (Z3210)
- Fix bug in LoggedBookmarkStore.prune that could result in an invalid bookmark in the store. (Z3165, Z3268) (AC-439)
Version 4.3.1.9 (2016-02-23)
Fixes and other changes:
- Fixed race condition that could cause an incorrect SubId in use error when a subscription is placed during a reconnect. (Z2915)
- Fixed
Message._copyTo
to properly copy Message objects where the individual Fields don't all share a single, large buffer. This applies primarily toMessage
objects created by the user, not ones received from the server.
Version 4.3.1.8 (2015-11-03)
Fixes and other changes:
- Fixed
Client
to callFailedWriteHandler
for any publish failure ack. Previously, onlynot entitled
andduplicate
acks would invoke theFailedWriteHandler
. (Z2372) - Fixed
BlockPublishStore
to not update the crc for a null value. (Z2367)
Version 4.3.1.7 (2015-10-20)
Fixes and other changes:
- Fixed
CompositeMessageParser
to correctly read all message sizes. There was an issue with some sizes due to Java promotion of byte to int for bit-shift operations that caused some values to be read incorrectly. (Z2181) - Fix
MemorySubscriptionManager
concurrency issues to prevent multiple threads accessing the internalHashMap
and also handle race conditions that can occur during resubscription after a reconnect. (Z2287) - Fix
Client.send
function to register theMessageHandler
with the sub id or query id rather than the command id for subscribe and sow functions.
Version 4.3.1.6 (2015-10-03)
Fixes and other changes:
- Fixed
CompositeMessageParser
to correctly read message sizes larger than 2^24. (Z2181) - Fix
MemorySubscriptionManager
to create its own copy of thesubId
to prevent it from having multiple subscriptions keyed by the same object. (Z2266)
Version 4.3.1.5 (2015-09-28)
Fixes and other changes:
- Fixed
BookmarkStore
classes to correctly serialize publisher id and sequence number asunsigned long
values. (Z2052) - Fixed
ExponentialDelayStrategy
to never return a delay larger than the maximum delay set on the strategy, even when using jitter. (Z2190) - Fixed
LoggedBookmarkStore.prune
to not attempt to seek to a negative position in the file if the file is empty. (Z2204)
Version 4.3.1.4 (2015-08-28)
Fixes and other changes:
- Change amps/json protocol implementation to support returning a
Password
field to customAuthenticator
objects. (Z2087)
Version 4.3.1.3 (2015-07-28)
Fixes and other changes:
- Change all
Store
implementations to set the initial sequence number to a large value based oncurrentTimeMillis
. This prevents backtracking in sequence numbers when simultaneous server and client failures occur and replication is in use. (Z1986) - Fix
LongField
to correctly return long values larger than the maximum value of anint
.
Version 4.3.1.2 (2015-07-03)
Fixes and other changes:
- Fix
MessageStream
to prevent hangs and OOM when used withHAClient
. TheHAClient
will no longer silently resubscribe aMessageStream
after theMessageStream
ends due to the client disconnecting. Instead, if the application wants to resume processing after failover, the application can reissue the subscribe command to get a newMessageStream
. If your application has been usingHAClient
withMessageStream
, review your usage to verify that your application expects theMessageStream
to end correctly. (Z1875) - Continue to wait for a
processed
ack until timeout is exceeded, even when anInterruptedException
is thrown. (Z1918)
Version 4.3.1.1 (2015-06-08)
Fixes and other changes:
- Correct distribution to include source JAR file. (Z1838)
Version 4.3.1.0 (2015-06-03)
This version of the AMPS Java client introduces and changes functionality.
Compatibility note:
- Message setters now return the current
Message
to allow setter calls to be easily chained together. If your application relies on the return type of these calls to bevoid
, you may need to adapt your application.
Fixes and other changes:
- Added
CompositeMessageBuilder
andCompositeMessageParser
classes for working with composite message types. - Added the
ReconnectDelayStrategy
interface that allows an application to specify how long theHAClient
waits between reconnection attempts. The client provides two implementations,ExponentialDelayStrategy
andFixedDelayStrategy
. - Changed accessibility of
CommandId.CommandId(byte[])
andCommandId.CommandId(byte[],int,int)
to public. (Z1643) - Removed
next()
method fromServerChooser
interface. This method was not called by the AMPS client. Implementations that provide the method should see no difference in behavior. (AC-114) - Added
is___Null()
methods to Message for every header field. (AC-107) - Changed default encoding of Field to UTF-8. (AC-304)
- Greater consistency in calling user supplied exception listener instead of silently "swallowing up" internal Exceptions. (AC-301, Z1642, Z1495)
- Call
discardUpTo
on the publish store when AMPS returns a persisted ack indicating that the message is either a duplicate or the publisher is not entitled. (Z1640) (AC-329) - Added
SowKey
field toCommand
andMessage
classes for publishing to a SOW topic that is externally keyed. AddedStoreWithKeys
interface that takes aMessage
. (AC-337) - A message stored in the publish store won't attempt to be resent after a reconnect because the store should have already replayed it. (AC-328)
- Added get/set
LogonCorrelationData
toClient
to provide a base64 field that can be used as additional correlation information about a client after it logs onto AMPS. (Z1539, AC-311) - Added
Timestamp
andNoSowKey
toMessage.Options
for buildingCommand
options strings. (Z1669, AC-356) - Message setters now return the current
Message
to allow setter calls to be easily chained together.
Java version 4.0
Version 4.0.1.4 (2015-05-22)
Fixes and other changes:
- Fix
MemorySubscriptionManager
to not resubscribe with thereplace
option. (Z1791, AC-354) - Fix
LoggedBookmarkStore
recovery when the server version is 3.8x or 3.9x. (Z1724) - Fix to correctly set the client sequence number in cases where the saved sequence number on the server is ahead of the sequence number in the client publish store (this defect was introduced in 4.0.1.0). (Z1803)
Version 4.0.1.3 (2015-05-18)
Fixes and other changes:
- Fix handling of empty header fields that could cause invalid JSON in amps protocol headers. This resulted in failures when the HAClient resubscribed after failover. (Z1762, Z1764)
- Add
MemoryPublishStore.BLOCK_SIZE
as a public static data member. This allows you to query the block size used for the class. (Z1587) - Bookmark stores now use
EPOCH
or the most recently seen bookmark for each publisher forMOST_RECENT
when no persisted ack has been received for a subscription. Previously, stores would return the last discarded bookmark when no persisted ack had been received. (Z1724) - The
prune()
method onLoggedBookMarkStore
may now throw aStoreException
.
Version 4.0.1.2 (2015-05-01)
Fixes and other changes:
- Fixes race condition in Client
publish()
,sowAndDeltaSubscribe()
,sowDelete()
,sowDeleteByKeys()
that could result in returning an incorrect orNULL
command ID or a sequence number of 0. (Z1700)
Version 4.0.1.1 (2015-04-24)
Fixes and other changes:
- Fixes race condition in
Client
subscribe methods where the returned CommandId can be reset before results are read. (Z1700) - Added
Client.getExceptionListener()
,getFailedWriteHandler()
andgetDuplicateMessageHandler()
. (Z1689,AC-331)
Version 4.0.1.0 (2015-03-12)
Fixes and other changes:
- Changed
MessageStream.next()
to throwNoSuchElementException
instead of returning null if it is called afterhasNext()
returns false (Z1496) - Throw an exception when an
"invalid bookmark"
error is returned from the server. (Z1543) - Added a
prune()
function toLoggedBookmarkStore
that will attempt to trim the underlying file down to only current state. (Z1227) PublishStore
now remembers the last sequence number even if the store is empty. Previously, an empty store meant the client would start with the sequence number provided by the server, which could be 0 if the server'sclients.ack
file had been removed possibly leading to messages being perceived as duplicates by replication destinations. (Z1227)- The timeout argument was being ignored for
Client.bookmarkSubscribe()
andClient.bookmarkDeltaSubscribe()
functions.
Version 4.0.0.3 (2015-02-25)
Fixes and other changes:
- Fixed failure to reconnect after a disconnect, connection failure, and then successful reconnect, and subsequent disconnect (Z1518).
Version 4.0.0.2 (2015-02-05):
Fixes and other changes:
- SPARK: Add
"-proto"
as a synonym for"-prot"
and use"-proto"
in spark help messages. (AC-295) - Updated compatibility notes for 4.0.0.0. (Z1427)
- Fixed
Client
version lookup to useClassLoader
instead ofURLClassLoader
. (Z1447)
Version 4.0.0.1 (2015-01-20)
Compatibility:
- Added new method
ServerChooser.getError()
for providing detailed error information. Classes that implement this interface directly must provide an implementation. (AC-270)
Fixes and other changes:
- Fixed possible deadlock in
HAClient
when a logon failure occurs duringconnectAndLogon()
. (Z1384) - Added new method
Client.getDisconnectHandler()
. - SPARK: Added check for JRE 1.6+ to spark shell script. (Z1393)
- SPARK: Fix documentation of the spark ping command to include specifying the protocol to match the destination. (Z1385)
- SPARK: Fix outdated usage message. (Z1393)
- SPARK: Include note that
-type
is treated as a synonym for-prot
. (Z1393) - Updated compatibility notes for 4.0.0.0.
Version 4.0.0.0 (2014-12-02)
This version of the AMPS Java Client is a major update to the programming interface. It introduces major 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:
- BREAKING CHANGE:
options
fields are now strings, not Integers. Multiple options are specified by listing each option delimited with comma. To support this change,Message.Options
has been changed from an enum to a class holding constant strings. - BREAKING CHANGE: the
PublishedDuplicateHandler
has been renamed to FailedWriteHandler, and it'spublishedDuplicate
method has been renamed tofailedWrite
and given an additional parameter,reason
. This method is called whenever a loggedpublish
orsow_delete
fails to be written on the server, due to being a duplicate or not entitled. - BREAKING CHANGE: The AMPS Java Client now requires JRE 1.6 or later.
- BREAKING CHANGE: Methods that execute a command against the server that
did not previously throw AMPSException may now throw AMPSException
(
publish
,deltaPublish
,startTimer
,stopTimer
).
This version introduces the following new features and fixes:
- Add new
Command
class to facilitate more flexible and easier execution of AMPS commands, along withexecute
andexecuteAsync
methods onClient
to execute aCommand
. - Include the AMPS Command Reference in the client distribution to provide
a guide to using the new
Command
class. - Add new
MessageStream
class returned by some methods onClient
to allow for easier iteration of results from AMPS subscriptions, queries and commands. - Transcode strings to UTF-8, not ISO-8859-1, when sending JSON and XML messages (AMPS280)
- Removed 22-character limit from command, subscription, and query IDs (AC222)
- Refactored
TCPTransport
andTCPTransportImpl
for easier creation of mock transports for unit testing. (AC238) - Added new
sowDeleteByKeys
andsowDeleteByData
methods for invokingsow_delete
in AMPS with SOWKeys and with exemplar data, respectively. - Corrected parsing of Password field in XML protocol. (AC237)
- Corrected parsing of failure reasons returned by AMPS in the "Reason" field. (AC226)
- Added
bookmarkDeltaSubscribe
method toClient
. (AC215) - Removed the erroneous
SendEmpties
option fromMessage.Options
. - Client now implements java.io.Closeable, so that Client may be used
in a
try-with-resources
statement. - Improve performance of processing replayed messages after a disconnect and resubscribe. (AC242, AC243, AC134)
- 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 new
ConnectionStateListener
interface for notification of connection and disconnection from an AMPS Client. - Prevent accidental disconnection during long SOW queries when using heartbeat functionality.
- Add CDATA escaping to topic and filter fields for XML protocol. (AC216)
- Use and resubscribe with multiple bookmarks to avoid missing messages when failing over between replication pairs.
- Increased robustness of
publishFlush()
method using newflush
command on the AMPS server when available. (AC182) - Renamed "message type" to "protocol" throughout the clients for consistency with AMPS 4.0 terminology.
- Renamed
setUnhandledMessageHandler
tosetLastChanceMessageHandler
. (AC197) - Cause all
sowDelete
methods to request a "stats" ack from the server. - Added support for
orderby
,bookmark
, andtopN
arguments tosow
,sowAndSubscribe
, andsowAndDeltaSubscribe
. - Added optional
subId
parameter to all subscription methods onClient
. - Fixed possible
ArrayIndexOutOfBoundsException
inBookmarkRingBuffer
that could happen during aresize
. (Z1272)
Updating Applications to 4.0.0.0
Starting with version 4.0.0.0, there is no longer an integer representation of options for AMPS commands. Instead, options are always represented as string values. Methods which previously accepted an integer for options have now been updated to use a string.
For example, if your code sets the oof
and send_keys
option on a
sowAndSubscribe command using the following code:
Message.Options.OOF | Message.Options.SendKeys
You would change this to use options as strings, as follows:
Message.Options.OOF + Message.Options.SendKeys
Or simply use the literal values of the options:
"oof,send_keys"
Replace references to MessageType
with Protocol
. For example, the
class previously named FixMessageType
is now named FIXProtocol
.
Version 3.8.0.11 (2014-09-16)
- Fix inconsistency in options for sending empty messages on
delta subscriptions. This change adds a
NoEmpties
option and ignores theSendEmpties
option (SendEmpties
is the default if no option is specified). (Z1007) - The
password
field returned from the server is now correctly parsed for XML messages (Z1007) - Improve handling of
reason
codes returned by the server. Parsing is more accurate. If the server returns an unknown reason, the client now throws aCommandException
with the text of the reason. (AC-226) - Fix replay behavior of
RingBookmarkStore
when receiving persisted acks. Previously, messages could overwrite the last persisted bookmark, causing replays to begin atEPOCH
even whenMOST_RECENT
was specified. (Z997)
Version 3.8.0.10 (2014-08-26)
- On reconnect,
HAClient
now resubscribes with the same options used to place the initial subscription when usingsowAndDeltaSubscribe
. (Z987)
Version 3.8.0.9 (2014-07-14)
-
spark: add
AuthenticatorFactory
interface and-authenticator
option to spark, enabling the use of custom authenticators. -
spark: add
-timeout
option to specify a command timeout (in milliseconds). This option applies to subscribe and all sow* commands. -
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.0.9 and later of the client. (Z880)
-
Messages now correctly set the options string when setting multiple options with
setOptions(int)
overload. -
Client
has new functiongetServerVersion
to return the version of the connected AMPS Server. This function returns a numeric value with the patternMajor 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 or not connected, this function will return 0. (Z884) -
Client has new function
getVersionAsInt
to convert a version String to an int for comparison with what is returned fromgetServerVersion
. This function will also work with shortened version strings, such as"3.8"
, which will return 3080000. (Z884)
Version 3.8.0.8 (2014-06-13)
-
Applications 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) -
Applications that use a Store for publishing 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)
Version 3.8.0.7 (2014-05-26)
- Prevent most
IOExceptions
inLoggedBookmarkStore.recover()
to allow the store to recover up to the point where the error occurs in the file.
Version 3.8.0.6 (2014-05-20)
- Prevent a
NullPointerException
inLoggedBookmarkStore
when the store needs to resize while it is still holding messages from a previous logon that have not been delivered from the server. (J195)
Version 3.8.0.5 (2014-05-19)
- Prevent a rare, timing-dependent
NullPointerException
by ensuring that a reader thread is fully shut down before starting a new reader thread. (Z686)
Version 3.8.0.4 (2014-05-13)
- Allow custom Transport implementations to be successfully registered
and used via the
TransportFactory
class. (Z782) - Add
reset
method toTransportFactory
for easier testing of custom Transport implementations. (Z782) - Prevent a
NullPointerException
fromLoggedBookmarkStore
when trying to discard a bookmark during failover and a rare sequence of events happens with specific timing. (Z686) - Prevent a
NullPointerException
fromMemoryBookmarkStore
whenisDiscarded
is called during recovery and certain other rare conditions exist involving the discarded state of various bookmarks in the store. (Z795)
Version 3.8.0.3 (2014-04-30)
- No longer produce
ArrayIndexOutOfBoundsException
while processing duplicate messages with a bookmark store. This problem was dependent on both a sequence of events and how the bookmark store kept processed bookmarks in memory. The problem could very rarely occur when the client received a message that had not been discarded, then received a number of discarded messages. (Z761) - Prevent hang on program exit. When one thread was trying to reconnect
and an explicit call to
disconnect()
occurred on another thread, the client could enter a state where a call todisconnect()
would not return.(Z753)
Version 3.8.0.2 (2014-04-23)
- Prevent outbound message corruption or null pointer exception. This could occur in rare cases when using heartbeat and sending messages to AMPS.
Version 3.8.0.1 (2014-04-22)
- Prevent null pointer exception. This could occur in rare cases when a client is both a publisher and a subscriber, is using a store for both the publication and subscription, and is communicating with a server version 3.8 or later.
- Message discards now correctly handle bookmark store resize in cases that could previously write to the wrong record, causing the wrong entry to be discarded.
- No longer consume excessive memory when recovering a large
LoggedBookmarkStore
. (Z605, Z746)
Version 3.8.0.0 (2014-03-10)
- Change version number so that major/minor version matches server release. There are no AMPS Java client releases versioned 3.3 through 3.7.
Message.getSowKey()
on XML messages no longer incorrectly adds a trailing double-quote character to the key returned.- Improve the interface for replacement subscriptions. Client
subscribe
,bookmarkSubscribe
,deltaSubscribe
, andbookmarkDeltaSubscribe
now allow a replacement subscription to be made using those functions. These functions updateSubscriptionManager
when replacing a subscription.SubscriptionManager
also correctly handles resubscribes with replacement filters. - Protect against unbounded store growth. Added
setResizeHandler
functions to the bookmark and publish store classes. This function allows you to set a callback that is called when a store is resized. Your callback can detect when a store is growing too large and handle the problem. - Protect against duplicate and lost messages when using bookmark live
subscription and failing over. This adds a
persisted()
function toBookmarkStore
classes as further protection against this problem. - Request persisted acks for bookmark subscription from AMPS server
versions that support it. This ties into the persisted addition on the
BookmarkStore
to fully guarantee all messages are seen during a failover when using a bookmark live subscription. - Get AMPS server version during logon. This allows the client to correctly handle any version-specific differences in behavior, and take advantage of features that are only available on more recent server releases.
- Remove spurious "Disconnect in progress" that could be sent to an exception listener during an intentional disconnect from the server.
- Empty XML message body returns empty string instead of SOAP Envelope tags
when
getData()
is used to inspect contents.
After version 3.2, the client version number was changed to match the server version number. There were no releases numbered 3.3 through 3.7.
Version 3.2.0.5 (2013-09-23)
- Added new
sowDeleteByKeys()
method toClient
. - Fixed possible message corruption caused by responding to a heartbeat message using the same message object in the client.
- Added the ability to provide a username for spark by passing in
user@host:port
for the-server
flag. This will supercede using the system user name.
Version 3.2.0.4 (2013-09-13)
- Add
close()
method toLoggedBookmarkStore
. - Close
LoggedBookmarkStore
automatically when a corrupt store file fails to be recovered, instead of leaving the file open. - Eliminated spurious client-side connection closure when java
select()
returned0
, but data is available to read. - Eliminated spurious `subid in use' error seen in the server log when a connection failure occurs in the midst of resubscribing after a prior connection failure.
- Change encoding of
Options
field in SOAP messages to match the server.
Version 3.2.0.3 (2013-07-30)
- Fix bookmark store duplicate detection bug where out of order discarding may result in duplicates delivered to the program's message handler after recovery.
- Speed up handling of first message in a bookmark subscription.
- Added new constructor to bookmark stores to allow setting a target number of subscriptions, so that internal ring buffers may be pre-allocated for performance. With the original constructor, we default to creating one internal ring buffer (enough for one subscription.)
Version 3.2.0.2 (2013-07-09)
- Do not wait
reconnectTimeout
on firstHAClient
connection. - Fixed
LoggedBookmarkStore
recovery bug where an undiscarded message at program exit causes future recovery to always occur from that point, even if that message is later discarded. - Changed
HADisconnectHandler
to make sure both 1-argument and 2-argument variants ofinvoke()
are always called when handling a disconnect, in case of a subclass that only overrides one of those two.
Version 3.2.0.1 (2013-05-16)
- Fixed bug where a successful call to
logon()
may, on occasion, fail or hang if it occurs immediately after a disconnect and reconnect event.
Version 3.2.0.0 (2013-03-08)
- Added
-rate
flag to spark. - Added new
HAClient
and associated classes for high availability. - Fixed bug whereby multiple concurrent invocations of
sow()
,sowAndSubscribe()
, etc. could result in spuriousTimedOutException
. - Added new
PublishStore
,BookmarkStore
implementations complementingHAClient
functionality. - Fixed hang when using spark with
sow_delete
and an XML message type.
Version 3.1.0.5 (2012-09-19)
- Fix issue with null
Authenticator
passed tologon()
. - Added version number to README file.
- Changed error message of
NotEntitledException
to include the the topic and a valid username.
Version 3.1.0.4 (2012-09-14)
- Added
NotEntitledException
.
Version 3.1.0.1 (2012-08-22)
- Send all queued data before closing, so that incomplete data is not sent to the server when disconnecting.
Version 3.1.0.0 (2012-08-16)
- Change
send(Message m)
to not send cached message. - Added support for custom authentication modules.
- Added support for TCP transport options.
- Fixed numerous shutdown/reconnect hangs and race conditions.