diff --git a/swh/search/cli.py b/swh/search/cli.py --- a/swh/search/cli.py +++ b/swh/search/cli.py @@ -62,8 +62,14 @@ default=["origin", "origin_visit"], help="Default list of object types to subscribe to", ) +@click.option( + "--prefix", + "-p", + default="swh.journal.objects", + help="Topic prefix to use (e.g swh.journal.indexed)", +) @click.pass_context -def journal_client_objects(ctx, stop_after_objects, object_type): +def journal_client_objects(ctx, stop_after_objects, object_type, prefix): """Listens for new objects from the SWH Journal, and schedules tasks to run relevant indexers (currently, origin and origin_visit) on these new objects. @@ -80,6 +86,7 @@ journal_cfg = config["journal"] object_types = object_type or journal_cfg.get("object_types") + prefix = prefix or journal_cfg.get("prefix") client = get_journal_client( cls="kafka", diff --git a/swh/search/tests/test_cli.py b/swh/search/tests/test_cli.py --- a/swh/search/tests/test_cli.py +++ b/swh/search/tests/test_cli.py @@ -76,6 +76,8 @@ "1", "--object-type", "origin", + "--prefix", + kafka_prefix, ], journal_objects_config, elasticsearch_host=elasticsearch_host,