Repository navigation
Conversation
Member
|
LGTM are there any other major changes needed in the 3.x branch? 4.x is the Cake6 Branch which will be published in February next year just like Cake6 itself. |
Member
Author
|
3.x still untagged, so such feature unbreaking changes not break the major release. Also this feature is non breaking change. 3.x stays cake5, and I will merge this feature to 4.x after it lands to 3.x. 4.x pull request already exists #203 so all will be done as fast as code lands for cake5. |
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.
Replaces the vendored
Enqueue\SimpleClient\SimpleClientwith a plugin ownedCake\Queue\Client\EnqueueClientbuilt from plain PHP arrays, while maintaining full backward compatibility with existing queue configs.Publishing becomes observable: the client dispatches
Queue.produce.successandQueue.produce.failureevents and exposes the transport assignedmessageId, mirroring the event set the worker side already has.QueueManager::push()now returns thatmessageIdon success andnullwhen a unique push is skipped as duplicate. The queue connection also gains aclientClassoption, mirroring the existingprocessoroption, so applications can extend the client per connection.Key Features:
Cake\Queue\Client\EnqueueClientwith the same public surface asSimpleClient(bindTopic,bindCommand,sendCommand,sendEvent,consume, plus driver, producer and consumer accessors), built withoutsymfony/configCake\Queue\Client\EnqueueClientConfignormalizes string DSN or array configs with the same defaults the vendor client used, and rejects unknown keys and mistyped values withInvalidArgumentExceptioninstead of silently ignoring themCake\Queue\Client\EnqueuePostSendExtensionobserves thePostSendcontext so the success event carriesmessageId,transportDestinationandtransportMessage; the id is never generated locally, it is read off the message the transport acceptedQueue.produce.failurewith the exception and rethrows, so the producer contract is preserved and no silent loss is possibleclientClassoption plus PSR-11 container support:QueueManager::setContainer()stores the application container as the static fallback,engine()accepts a per call container override, andconnection_factory_classresolves through the container when availableenqueue/simple-clientremoved fromcomposer.jsonrequire; runtime now needs onlycakephp/cakephp,psr/logandramsey/uuidUsage:
Note: existing
Queueconfigs work without edits, and callers that ignore thepush()return value are unaffected. Code type hinted againstSimpleClientmust switch toEnqueueClient. Direct calls ongetProducer()->sendEvent()orsendCommand()bypass the produce events; onlyEnqueueClient::sendEvent(),EnqueueClient::sendCommand()andQueueManager::push()dispatch them.