Skip to content

Commit

Permalink
warn when queue settings are too late in a configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Dec 17, 2024
1 parent c1950a9 commit 24cbe4b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sarracenia/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ def __repr__(self) -> str:

perm_options = [ 'permDefault', 'permDirDefault','permLog']

# options that apply to queues, and so must appear before subtopic resolves queues characteristics.
#
queue_options = [ 'auto_delete', 'broker', 'durable', 'exchange', 'exchangeSuffix', 'expire', 'message_ttl', 'prefetch', \
'qos', 'queueBind', 'exchangeDeclare' ]

size_options = ['accelThreshold', 'blockSize', 'bufSize', 'byteRateMax', 'fileSizeMax', 'inlineByteMax']

str_options = [
Expand Down Expand Up @@ -1626,6 +1631,10 @@ def parse_line(self, component, cfg, cfname, lineno, l ):
self.logEvents = self.logEvents | set(['nodupe'])
return

if k in queue_options and self.subtopic_seen:
logger.warning( f"{','.join(self.files)}:{lineno} {k} needs to appear before *subtopic*" \
" unless you need different queues to have different settings")

if len(line) < 2:
logger.error( f"{','.join(self.files)}:{lineno} {k} missing argument(s)" )
return
Expand Down

0 comments on commit 24cbe4b

Please sign in to comment.