public function registerDestinationForMessages(DeliveryDestination $deliveryDestination, string ...$messages): self
    {
        /**
         * @noinspection PhpUnhandledExceptionInspection
         *
         * @var Endpoint $applicationEndpoint
         */
        $applicationEndpoint = $this->getKernelContainerService(Endpoint::class);

        $newEndpoint = $applicationEndpoint->withNewDeliveryDestination($deliveryDestination);

        return $this->registerEndpointForMessages($newEndpoint, ...$messages);
    }
public function registerDestinationForMessages(DeliveryDestination $deliveryDestination, string ...$messages): self
    {
        /**
         * @noinspection PhpUnhandledExceptionInspection
         *
         * @var Endpoint $applicationEndpoint
         */
        $applicationEndpoint = $this->getKernelContainerService(Endpoint::class);

        $newEndpoint = $applicationEndpoint->withNewDeliveryDestination($deliveryDestination);

        return $this->registerEndpointForMessages($newEndpoint, ...$messages);
    }
public function registerDestinationForMessages ( DeliveryDestination $ deliveryDestination , string ... $ messages ) : self { /**
         * @noinspection PhpUnhandledExceptionInspection
         *
         * @var Endpoint $applicationEndpoint
         */ $ applicationEndpoint = $ this -> getKernelContainerService ( Endpoint :: class ) ; $ newEndpoint = $ applicationEndpoint -> withNewDeliveryDestination ( $ deliveryDestination ) ; return $ this -> registerEndpointForMessages ( $ newEndpoint , ... $ messages ) ; }
Like the registerEndpointForMessages method, it adds a custom message delivery route.
The only difference is that the route is specified for the current application transport.

@noinspection PhpDocMissingThrowsInspection

@param DeliveryDestination $deliveryDestination
@param string              ...$messages

@return ServiceBusKernel
Like the registerEndpointForMessages method it adds a custom message delivery route . The only difference is that the route is specified for the current application transport .