Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-17424

Make Elasticsearch sequence and audit indexes more consistent / configurable

    XMLWordPrintable

    Details

    • Impact type:
      API change
    • Upgrade notes:
      Hide

      Removed ESUIDSequencer#SEQUENCER_CONTRIB
      Removed ESUIDSequencer#IDX_NAME
      Added UIDSequencer#getName()
      Added UIDSequencer#setName(String name)
      Changed esSequencer contribution name to uidgen

      Show
      Removed ESUIDSequencer#SEQUENCER_CONTRIB Removed ESUIDSequencer#IDX_NAME Added UIDSequencer#getName() Added UIDSequencer#setName(String name) Changed esSequencer contribution name to uidgen
    • Sprint:
      Drive August, Drive
    • Story Points:
      2

      Description

      1/ About the elasticsearch-uidgen-sequencer-contrib.xml contribution:

        <extension target="org.nuxeo.ecm.platform.uidgen.service.UIDGeneratorService" point="sequencers">
          <sequencer name="esSequencer" class="org.nuxeo.elasticsearch.seqgen.ESUIDSequencer"></sequencer>
        </extension>
      

      we should make the sequencer name be used as the related Elasticsearch index name to avoid having a bad binding like it was the case for NXP-17422.
      To ensure the index has well been defined we could make the ESUIDSequencer fail if such an index doesn't exist.

      2/ The ESAuditBackend should use the default sequencer, not the "esSequencer" (ESUIDSequencer#SEQUENCER_CONTRIB) hardcoded one.
      This way one could use a Redis sequencer (see NXP-17306) instead.

      Doing so should be easy by defining ESUIDSequencer as the default sequencer with:

        <extension target="org.nuxeo.ecm.platform.uidgen.service.UIDGeneratorService" point="sequencers">
          <sequencer name="esSequencer" default="true" class="org.nuxeo.elasticsearch.seqgen.ESUIDSequencer"></sequencer>
        </extension>
      

      and using

      UIDSequencer seq = uidGeneratorService.getSequencer();
      

      in ESAuditBackend.

      3/ The Elasticsearch index name used by ESAuditBackend should be configurable.
      Instead of using hardcoded "audit" (ESAuditBackend#IDX_NAME) we could use something like

        <extension target="org.nuxeo.ecm.platform.audit.service.NXAuditEventsService"
      	     point="backend">
          <backend class="org.nuxeo.elasticsearch.audit.ESAuditBackend">
            <paramaters>
              <parameter name="index">audit</parameter>
            </paramaters>
          </backend>
        </extension>
      

      This should allow to have several Nuxeo instances using the same Elasticsearch cluster.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: