@@ -67,15 +67,15 @@ async def handle_message_from_dlq(message_frame: stompman.MessageFrame) -> None:
67
67
print (message_frame.body)
68
68
69
69
70
- await client.subscribe(" DLQ" , handle_message_from_dlq)
70
+ await client.subscribe(" DLQ" , handle_message_from_dlq, on_suppressed_exception = print )
71
71
```
72
72
73
73
Entered ` stompman.Client ` will block forever waiting for messages if there are any active subscriptions.
74
74
75
75
Sometimes it's useful to avoid that:
76
76
77
77
``` python
78
- dlq_subscription = await client.subscribe(" DLQ" , handle_message_from_dlq)
78
+ dlq_subscription = await client.subscribe(" DLQ" , handle_message_from_dlq, on_suppressed_exception = print )
79
79
await dlq_subscription.unsubscribe()
80
80
```
81
81
@@ -93,10 +93,10 @@ You can change the ack mode used by specifying the `ack` parameter:
93
93
94
94
``` python
95
95
# Server will assume that all messages sent to the subscription before the ACK'ed message are received and processed:
96
- await client.subscribe(" DLQ" , handle_message_from_dlq, ack = " client" )
96
+ await client.subscribe(" DLQ" , handle_message_from_dlq, ack = " client" , on_suppressed_exception = print )
97
97
98
98
# Server will assume that messages are received as soon as it send them to client:
99
- await client.subscribe(" DLQ" , handle_message_from_dlq, ack = " auto" )
99
+ await client.subscribe(" DLQ" , handle_message_from_dlq, ack = " auto" , on_suppressed_exception = print )
100
100
```
101
101
102
102
### Cleaning Up
0 commit comments