Added doc for SiteAccessStamp - #3340
Conversation
* Described stamps for Ibexa Messenger * Fixed typos * Link to Symfony messages
Preview of modified filesPreview of modified Markdown: |
|
|
||
| The stamp changes the configuration scope only. | ||
| It doesn't change the SiteAccess in the `Ibexa\Core\MVC\Symfony\SiteAccess\SiteAccessServiceInterface` service. | ||
| `SiteAccessServiceInterface::getCurrent()` always returns the SiteAccess that the worker process started with, for all messages. |
There was a problem hiding this comment.
Side note: Will be fixed in ibexa/core#798 / 6.0.
We could also make SiteAccessService to listen to CONFIG_SCOPE_CHANGE events in 5.x and react accordingly, and backport the stack feature from 6.0. In theory this is a bug (SiteAccessService::getCurrent() returning wrong site access), so we would not exactly break BC promise - but initially I thought we shouldn't.
@konradoboza @alongosz @ibexa/php-dev ?
There was a problem hiding this comment.
So, if I understand correctly, this note can be removed in 5.0 and 6.0 when ibexa/core#805 is merged? Depending on whether it gets merged before or after the release, in this PR or in a follow-up.
Co-authored-by: Paweł Niedzielski <pawel.niedzielski@ibexa.co>
adriendupuis
left a comment
There was a problem hiding this comment.
As a SomeMessage object isn't created and dispatched, the doc seems incomplete.
"Route message to background queue" should be more clearly mandatory and a follow up of handler creation in previous section. An handler alone doesn't sent to background tasks queue? No, you need a message provider tagged properly to forward the message to background. Maybe a little summary of the needed elements before entering into code examples?
| Use the `--siteaccess` option to set the default [SiteAccess](multisite_configuration.md#siteaccess-configuration) and [repository](repository_configuration.md#defining-custom-connection) for the worker process. | ||
| The worker uses this SiteAccess for every message that doesn't have a [`SiteAccessStamp`](#siteaccessstamp). |
There was a problem hiding this comment.
Do we hare reco about what should be the default SiteAccess?
I don't remember why I used admin in https://doc.ibexa.co/en/5.0/getting_started/install_with_ddev/#configure-background-tasks-optional
There was a problem hiding this comment.
@Steveb-p what do you think, which SiteAccess should the worker use by default - can we recommend something?
I guess it doesn't matter, as long it's one SA per each repository configured and SiteAccess stamps are added correctly
| In [multi-repository setups](repository_configuration.md), run one worker process for each repository. | ||
| With this setup, each worker process can connect to the right database. |
There was a problem hiding this comment.
Again, which siteaccess to pick-up? A random front or the back office?
|
@adriendupuis please have a look at fe4b1b3 - I've changed the example to create a custom message, and added more info about the need for sending to transport. |
code_samples/ change report
|
adriendupuis
left a comment
There was a problem hiding this comment.
Could be nice to have an additional note about what to consider when picking up a default SiteAccess to run the background worker.
But my main previous concern is solved and this is mergeable.
Documentation for ibexa/messenger#13
Turns out we didn't have the "send the message to the transport" covered - adding this as well.
One TODO left: add the missing link once PHP API reference is regenerated