Skip to content

Commit

Permalink
NGSTACK-805: adjust configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Nov 15, 2023
1 parent 34e4678 commit d5b1724
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 1 addition & 4 deletions bundle/Resources/config/messenger.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
messenger:
reset_on_message: true
transports:
netgen_ibexa_search_extra_asynchronous_indexing:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
Expand Down Expand Up @@ -46,6 +45,4 @@ messenger:
'Netgen\IbexaSearchExtra\Core\Search\Common\Messenger\Message\Search\User\UpdateUser': netgen_ibexa_search_extra_asynchronous_indexing
default_bus: messenger.bus.default
buses:
messenger.bus.default:
middleware:
- doctrine_ping_connection
messenger.bus.default: ~
23 changes: 21 additions & 2 deletions docs/reference/asynchronous_indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,28 @@ In order to enable asynchronous indexing, use the following configuration:
`Default Messenger component configuration <https://github.com/netgen/ibexa-search-extra/blob/master/bundle/Resources/config/messenger.yaml>`_
will be automatically loaded. In case you want to use a different configuration, you will have to override it in the
project code. Additionally, you will need to start the consumer to process the queue. For the default configuration,
you can do that with:
project code. Note that it would be recommended to configure the bus used with ``doctrine_ping_connection`` middleware,
since the asynchronous indexing consumer will typically be a long running process, which could otherwise lose the
connection to the database. This setting is not included in the default configuration as it's a global setting and you
might not want to have it enabled by default. You can enable it in the ``buses`` part of the Messenger configuration
with:

.. code-block:: yaml
buses:
messenger.bus.default:
middleware:
- doctrine_ping_connection
Additionally, you will need to start the consumer to process the queue. For the default configuration, you can do that
with:

.. code-block:: console
bin/console messenger:consume netgen_ibexa_search_extra_asynchronous_indexing --time-limit=1800 --limit=4096
.. note::

Event subscribers use a Messenger message bus service named ``netgen.ibexa_search_extra.asynchronous_indexing.messenger.bus``,
which is an alias to the default ``messenger.default_bus`` service. This enables override of the message bus used in
event listeners when needed.

0 comments on commit d5b1724

Please sign in to comment.