Skip to content

Commit ea52a7c

Browse files
committed
solid queue
1 parent 340b43d commit ea52a7c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Producing-Messages.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ Sidekiq.configure_server do |config|
8989
end
9090
```
9191

92+
### Closing Producer Used in Solid Queue
93+
94+
```ruby
95+
# config/initializers/solid_queue.rb
96+
97+
# This code will close the producer in each worker process
98+
SolidQueue.on_worker_exit do
99+
::Karafka.producer.close
100+
end
101+
102+
# Below is optional - useful only when publishing events to Kafka
103+
# from the supervisor process
104+
SolidQueue.on_exit do
105+
::Karafka.producer.close
106+
end
107+
```
108+
92109
### Closing Producer Used in Passenger
93110

94111
```ruby

0 commit comments

Comments
 (0)