v5.0.0
Description
The minimum PHP version should now be >=8.0
The application has been designed to be more reliable (while the speed has been reduced).
Unfortunately, there are also a large number of backward compatibility violations..
Integrations with travis-ci and scrutinizer have been removed for all repositories. GitHub Actions is now used instead.
Common
- ServiceBusContext
- violations() method previously returned an array, now returns a ValidationViolations object in case validation is enabled and there are violations.
- Removed logContextThrowable(), logContextMessage() methods
- A logger(), method has been added that returns a ContextLogger object. In addition to the methods that are available by default within LoggerInterfacе, the throwable() method method is also available
- Removed operationId(), traceId() methods
- A metadata(), method has been added that returns an IncomingMessageMetadata object
- return() method has been removed
- The deliveryBulk(), method has been added, with which you can send several messages in transactional mode (if the transport does not support transactionality, then messages will be sent concurrently).
- The delivery() and deliveryBulk() methods can now specify metadata as the last argument using OutcomeMessageMetadata. Metadata will be transferred to the transport in the form of headers. The withTraceId() and traceId() methods have been removed from DeliveryOptions. The withHeader() method is now immutable
Service Bus
- Bootstrap
- All initialization methods now accept the absolute path to the root directory of the project as the first parameter.
- In the container, you can now use environment variable resolving.
- Configuration
- Removed CommandHandler and EventListener annotations. CommandHandler and EventListener attributes are now used instead
- The ability to automatically respond to a runtime or validation error has been removed (Previously, the configuration was specified using the defaultThrowableEvent and defaultValidationFailedEvent properties).
- Maximum execution time (in seconds) can now be specified for the CommandHandler. In case of a timeout, the message will be sent back to the queue.
- Previously, the timeout was set only globally for the entire application using the EntryPoint configuration. Now this possibility no longer exists. The global timeout for all command handlers is 600 seconds.
- Removed CommandHandler and EventListener annotations. CommandHandler and EventListener attributes are now used instead
- Reprocessing messages
- Added RetryStrategy interface
- The general principle of work looks like this:
- For example, we have 1 event and 5 listeners are registered for it. If 2/5 listeners fail, then the message will be sent to the queue indicating the handlers in which the error occurred. After receiving the message, it will be executed only in 2 handlers (in which an error occurred). The process is recursive and lasts until the number of resend attempts expires. After the attempts have been exhausted, the backoff() method is called, in which you can implement, for example, saving a message somewhere for processing in the future.
- The default implementation is SimpleRetryStrategy
- For configuration SimpleRetryCompilerPass used
- Currently there is no possibility to specify processing strategies for a specific handler. This will be fixed in future releases
Transport
- Important: the default serializer mechanism has been changed.
- Previously, the message (json) consisted of two keys: namespace, which contained the message class, as well as message, which contained the data. Now the message contains ONLY data, and the type information is transferred in the header x-message-type
Sagas
- Removed SagaHeader, SagaEventListener annotations
- SagaHeader and SagaEventListener attributes are now used instead
Http client
- For ArtaxHttpClient added the ability to create on the basis of the already configured DelegateHttpClient
Annotations reader
- Despite the name, it no longer allows reading annotations and works exclusively with attributes