- Added
Sender
support for delayed confirmation of message settlement and retrieval of delivery state.Sender.SendWithReceipt
sends a message and returns aSendReceipt
.SendReceipt.Wait
waits for confirmation of settlement and returns the message's delivery state.- The
DeliveryState
interface encapsulates concrete delivery outcomesStateAccepted
,StateModified
,StateRejected
,StateReleased
and non-terminal delivery stateStateReceived
.
- Added methods
Done
andErr
toConn
Done
returns a channel that's closed whenConn
has closed.Err
explains whyConn
was closed.
- encoding.Symbol was exposed as a public type
Symbol
.
- Added type
Null
used to send an AMQPnull
message value. - Added method
Properties
toConn
,Session
,Receiver
, andSender
which contains the peer's respective properties.
- Fixed a rare race in
Conn.start
that could cause goroutines to be leaked if the provided context was canceled/expired.
- The field
MessageHeader.Durable
is not omitted when it'sfalse
.
- ConnError, SessionError and LinkError now work with errors.As(), making it easier to write generalized error handling code that wants to deal with *amqp.Error's.
- Fixed an issue that could cause delays when parsing small frames.
- A
Receiver
's unsettled messages are tracked as a count (currently used for diagnostic purposes only).
- Fixed an issue that could cause a memory leak when settling messages across
Receiver
instances.
- Fixed an issue that could cause frames to be sent even when the provided
context.Context
was cancelled. - Fixed a potential hang in
Sender.Send()
that could happen in rare circumstances. - Ensure that
Sender
's delivery count and link credit are updated when a transfer fails to send due to context cancellation/timeout.
- Fixed an issue that could cause links to terminate with error "received disposition frame with unknown link handle X".
- Added
ConnOptions.WriteTimeout
to control the write deadline when writing tonet.Conn
.
- Calling
Dial()
with a cancelled context doesn't create a connection. - Context cancellation is properly honored in calls to
Dial()
andNewConn()
. - Fixed potential race during
Conn.Close()
. - Disable sending frames when closing
Session
,Sender
, andReceiver
. - Don't leak in-flight messages when a message settlement API is cancelled or times out waiting for acknowledgement.
Sender.Send()
will return an*amqp.Error
with conditionamqp.ErrCondTransferLimitExceeded
when attempting to send a transfer on a link with no credit.Sender.Send()
will return an*amqp.Error
with conditionamqp.ErrCondMessageSizeExceeded
if the message or delivery tag size exceeds the maximum allowed size for the link.
- Debug logging includes the address of the object that's writing a log entry.
- Context expiration or cancellation when creating instances of
Session
,Receiver
, andSender
no longer result in the potential forConn
to unexpectedly terminate. - Session channel and link handle exhaustion will now return
*ConnError
and*SessionError
respectively, closing the respectiveConn
orSession
. - If a
context.Context
contains a deadline/timeout, that value will be used as the write deadline when writing tonet.Conn
.
- Fixed a race closing a
Session
,Receiver
, orSender
in succession when the first attempt times out. - Check the
LinkError.RemoteErr
field when determining if a link was cleanly closed.
Dial()
andNewConn()
now require acontext.Context
as their first parameter.- As a result, the
ConnOptions.Timeout
field has been removed.
- As a result, the
- Methods
Sender.Send()
andReceiver.Receive()
now take their respective options-type as the final argument. - The
ManualCredits
field inReceiverOptions
has been consolidated into fieldCredit
. - Renamed fields in the
ReceiverOptions
for configuring options on the source. - Renamed
DetachError
toLinkError
as "detach" has a specific meaning which doesn't equate to the returned link errors. - The
Receiver.DrainCredit()
API has been removed. - Removed fields
Batching
andBatchMaxAge
inReceiverOptions
. - The
IncomingWindow
andOutgoingWindow
fields inSessionOptions
have been removed. - The field
SenderOptions.IgnoreDispositionErrors
has been removed.- By default, messages that are rejected by the peer no longer close the
Sender
.
- By default, messages that are rejected by the peer no longer close the
- The field
SendSettled
in typeMessage
has been moved to typeSendOptions
and renamed asSettled
. - The following type aliases have been removed.
Address
,Binary
,MessageID
,SequenceNumber
,Symbol
- Method
Message.LinkName()
has been removed.
- Don't discard incoming frames while closing a Session.
- Client-side termination of a Session due to invalid state will wait for the peer to acknowledge the Session's end.
- Fixed an issue that could cause
creditor.Drain()
to return the wrong error when a link is terminated. - Ensure that
Receiver.Receive()
drains prefetched messages when the link closed. - Fixed an issue that could cause closing a
Receiver
to hang under certain circumstances. - In
Receiver.Drain()
, wake upReceiver.mux()
after the drain bit has been set.
- Debug logging has been cleaned up to reduce the number of redundant entries and consolidate the entry format.
- DEBUG_LEVEL 1 now captures all sent/received frames along with basic flow control information.
- Higher debug levels add entries when a frame transitions across mux boundaries and other diagnostics info.
- Document default values for incoming and outgoing windows.
- Refactored handling of incoming frames to eliminate potential deadlocks due to "mux pumping".
- Disallow sending of frames once the end performative has been sent.
- Clean up client-side state when a
context.Context
expires or is cancelled and document the potential side-effects. - Unexpected frames will now terminate a
Session
,Receiver
, orSender
as required. - Cleaned up tests that triggered the race detector.
- Fixed an issue that could cause
Conn.connReader()
to become blocked in rare circumstances. - Fixed an issue that could cause outgoing transfers to be rejected by some brokers due to out-of-sequence delivery IDs.
- Fixed an issue that could cause senders and receivers within the same session to deadlock if the receiver was configured with
ReceiverSettleModeFirst
. - Enabled support for senders in an at-most-once configuration.
- The connection mux goroutine has been removed, eliminating a potential source of deadlocks.
- Automatic link flow control is built on the manual creditor.
- Clarified docs that messages received from a sender configured in a mode other than
SenderSettleModeSettled
must be acknowledged. - Clarified default value for
Conn.IdleTimeout
and removed unit prefix.
- Added
ConnError
type that's returned when a connection is no longer functional. - Added
SessionError
type that's returned when a session has been closed. - Added
SASLType
used when configuring the SASL authentication mechanism. - Added
Ptr()
method toSenderSettleMode
andReceiverSettleMode
types.
- The minimum version of Go required to build this module is now 1.18.
- The type
Client
has been renamed toConn
, and its constructorNew()
renamed toNewConn()
. - Removed
ErrConnClosed
,ErrSessionClosed
,ErrLinkClosed
, andErrTimeout
sentinel error types. - The following methods now require a
context.Context
as their first parameter.Conn.NewSession()
,Session.NewReceiver()
,Session.NewSender()
- Removed
context.Context
parameter anderror
return from methodReceiver.Prefetched()
. - The following type names had the prefix
AMQP
removed to prevent stuttering.AMQPAddress
,AMQPMessageID
,AMQPSymbol
,AMQPSequenceNumber
,AMQPBinary
- Various
Default*
constants are no longer exported. - The args to
Receiver.ModifyMessage()
have changed. - The "variadic config" pattern for
Conn
,Session
,Sender
, andReceiver
constructors has been replaced with a struct-based config.- This removes the
ConnOption
,SessionOption
, andLinkOption
types and all of the associated configuration funcs. - The sender and receiver specific link options have been moved into their respective options types.
- The
ConnTLS()
option was removed as part of this change.
- This removes the
- The
Dial()
andNew()
constructors now require an*ConnOptions
parameter. Conn.NewSession()
now requires a*SessionOptions
parameter.Session.NewSender()
now requirestarget
address and*SenderOptions
parameters.Session.NewReceiver()
now requiressource
address and*ReceiverOptions
parameters.- The various SASL configuration funcs have been slightly renamed.
- The following constant types had their values renamed in accordance with the SDK design guidelines.
SenderSettleMode
,ReceiverSettleMode
,ExpiryPolicy
- Constant type
ErrorCondition
has been renamed toErrCond
.- The
ErrCond
values have had their names updated to include theErrCond
prefix.
- The
LinkFilterSource
andLinkFilterSelector
have been renamed toNewLinkFilter
andNewSelectorFilter
respectively.- The
RemoteError
field inDetachError
has been renamed.
- Fixed potential panic in
muxHandleFrame()
when checking for manual creditor. - Fixed potential panic in
attachLink()
when copying source filters. NewConn()
will no longer return a broken*Conn
in some instances.- Incoming transfer frames received during initial link detach are no longer discarded.
- Session will no longer flood peer with flow frames when half its incoming window is consumed.
- Newly created
Session
won't leak if the context passed toConn.NewSession()
expires before exit. - Newly created
link
won't leak if the context passed tolink.attach()
expires before exit. - Fixed an issue causing dispositions to hang indefinitely with batching enabled when the receiver link is detached.
- Errors when reading/writing to the underlying
net.Conn
are now wrapped in aConnError
type. - Disambiguate error message for distinct cases where a session wasn't found for the specified remote channel.
- Removed
link.Paused
as it didn't add much value and was broken in some cases. - Only send one flow frame when a drain has been requested.
- Session window size increased to 5000.
- Creation and deletion of
Session
instances have been made deterministic. - Allocation and deallocation of link handles has been made deterministic.