Fixing service wiring

This commit is contained in:
Cyber MacGeddon 2026-03-04 14:12:11 +00:00
parent 3d61ecd060
commit a625efb94b
4 changed files with 124 additions and 21 deletions

View file

@ -255,13 +255,13 @@ class ToolServiceImpl:
# If topic already contains "://", assume it's a full Pulsar URI
# Otherwise, construct default path
if '://' in self.service_topic:
# Full Pulsar URI provided
request_topic = f"{self.service_topic}-request"
response_topic = f"{self.service_topic}-response"
# Full Pulsar URI provided - use as base for request/response
request_topic = self.service_topic.replace("://tg/", "://tg/request/")
response_topic = self.service_topic.replace("://tg/", "://tg/response/")
else:
# Construct default path matching DynamicToolService pattern
request_topic = f"non-persistent://tg/request/{self.service_topic}-request"
response_topic = f"non-persistent://tg/response/{self.service_topic}-response"
request_topic = f"non-persistent://tg/request/{self.service_topic}"
response_topic = f"non-persistent://tg/response/{self.service_topic}"
request_metrics = ProducerMetrics(
processor=self.processor.id,

View file

@ -174,6 +174,11 @@ class Processor(DynamicToolService):
@staticmethod
def add_args(parser):
DynamicToolService.add_args(parser)
# Override the topic default for this service
for action in parser._actions:
if '--topic' in action.option_strings:
action.default = default_topic
break
def run():