Skip to content

Commit 745fbbb

Browse files
committed
ACKs are now correctly allocated to channels
slightly modify the SampleConsumer to make it easier to use as a base for these kind of tests
1 parent 71de0af commit 745fbbb

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/workflows/services/sample_consumer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def consume_message(self, header, message):
2424
t = (time.time() % 1000) * 1000
2525

2626
if header:
27-
header = json.dumps(header, indent=2) + "\n" + "----------------" + "\n"
27+
header_str = json.dumps(header, indent=2) + "\n" + "----------------" + "\n"
2828
else:
29-
header = ""
29+
header_str = ""
3030
if isinstance(message, dict):
3131
message = json.dumps(message, indent=2) + "\n" + "----------------" + "\n"
3232

3333
self.log.info(
34-
f"=== Consume ====\n{header}{message}\nReceived message @{t:10.3f} ms"
34+
f"=== Consume ====\n{header_str}{message}\nReceived message @{t:10.3f} ms"
3535
)
3636
time.sleep(0.1)

src/workflows/transport/pika_transport.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,10 +826,6 @@ def subscribe_queue(
826826
if not self._connection:
827827
raise RuntimeError("Cannot subscribe to unstarted connection")
828828

829-
# Safety: Since our Ack interface doesn't ask consumer ID yet, we can't ack
830-
if not auto_ack and prefetch_count != 0:
831-
raise ValueError("Cannot turn on manual acknowledgements with prefetch > 0")
832-
833829
new_sub = _PikaSubscription(
834830
arguments={},
835831
auto_ack=auto_ack,

0 commit comments

Comments
 (0)