Skip to content

Commit

Permalink
Unbind queue before worker termination
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanecek committed Sep 3, 2024
1 parent 94a9cbd commit 0892135
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion source/Ansible-RabbitMQ-Tests/RabbitMQClientTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ RabbitMQClientTest >> runWorkerNamed: aName consumingFrom: aQueueName bindedTo:
]
processingPayloadWith: aProcessingBlock.
worker bindQueueTo: anExchange routedBy: aRoutingKey.
[ worker start ] ensure: [ worker stop ]
[ worker start ] ensure: [
worker unbindQueueTo: anExchange routedBy: aRoutingKey.
worker stop
]
] newProcess.
process
name: aName;
Expand Down
8 changes: 7 additions & 1 deletion source/Ansible-RabbitMQ/RabbitMQWorker.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ RabbitMQWorker class >> configuredBy: aConfigurationAction processingPayloadWith
processingMessagesWith: [ :message | aPayloadProcessor value: message body ]
]

{ #category : 'Configuring' }
{ #category : 'configuring' }
RabbitMQWorker >> bindQueueTo: anExchange routedBy: aRoutingKey [

self
Expand Down Expand Up @@ -144,3 +144,9 @@ RabbitMQWorker >> startProcessing [
]
] repeat
]

{ #category : 'configuring' }
RabbitMQWorker >> unbindQueueTo: anExchange routedBy: aRoutingKey [

channel queueUnbind: self queueName exchange: anExchange routingKey: aRoutingKey
]

0 comments on commit 0892135

Please sign in to comment.