refactor(amqp)!: migrate to go-amqp v1.x API#1226
Open
fxsml wants to merge 2 commits intocloudevents:mainfrom
Open
refactor(amqp)!: migrate to go-amqp v1.x API#1226fxsml wants to merge 2 commits intocloudevents:mainfrom
fxsml wants to merge 2 commits intocloudevents:mainfrom
Conversation
BREAKING CHANGE: This migration updates the AMQP protocol binding from go-amqp v0.17.0 to v1.x with significant API changes. Changes: - Update to go-amqp v1.x (remove replace directive) - Rename *Client types to *Conn to match go-amqp v1.x - Rename NewProtocolFromClient → NewProtocolFromConn (and variants) - Use struct-based options instead of functional options - Remove non-functional WithConnSASLPlain, WithConnOptions, WithSessionOptions - Simplify to WithSenderOptions and WithReceiverOptions only - Add MIGRATION.md with upgrade guide and examples See MIGRATION.md for detailed upgrade instructions. Fixes cloudevents#1039 Signed-off-by: fxsml <[email protected]>
Add comprehensive integration tests for go-amqp v1.x migration: - Direct AMQP connection with SASL Plain authentication - CloudEvents protocol binding (NewProtocol, NewProtocolFromConn) - Queue send/receive roundtrip with message verification - Topic/subscription pub-sub pattern roundtrip - Proper message acknowledgment with Finish() Tests validate the migration works correctly with real Azure Service Bus. Set SERVICEBUS_CONNECTION environment variable to run. Signed-off-by: fxsml <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
replacedirective not propagating to downstream usersBreaking Changes
The go-amqp v1.x API is fundamentally different from v0.17.0:
[]amqp.ConnOption{amqp.ConnSASLPlain(...)}&amqp.ConnOptions{SASLType: amqp.SASLTypePlain(...)}[]amqp.SessionOption{}*amqp.SessionOptions{}ornilSee MIGRATION.md for complete migration guide.
Why This Fix Is Necessary
The
replacedirective ingo.modonly applies to the main module, not to downstream dependencies. When users import the CloudEvents AMQP package, Go's MVS selects go-amqp v1.x (from other dependencies like Azure SDKs), causing compilation failures.Test Plan
cd protocol/amqp/v2 && go test ./...SERVICEBUS_CONNECTIONenv var)