Class: Karafka::Web::Pro::Ui::Controllers::ScheduledMessages::MessagesController
- Inherits:
-
BaseController
- Object
- Ui::Controllers::BaseController
- BaseController
- BaseController
- Karafka::Web::Pro::Ui::Controllers::ScheduledMessages::MessagesController
- Defined in:
- lib/karafka/web/pro/ui/controllers/scheduled_messages/messages_controller.rb
Overview
Provides management of schedules related messages
Constant Summary
Constants inherited from Ui::Controllers::BaseController
Ui::Controllers::BaseController::Models
Instance Method Summary collapse
-
#cancel(topic_id, partition_id, message_offset) ⇒ Object
Generates a cancel request for a given schedule message.
Methods inherited from Ui::Controllers::BaseController
Constructor Details
This class inherits a constructor from Karafka::Web::Ui::Controllers::BaseController
Instance Method Details
#cancel(topic_id, partition_id, message_offset) ⇒ Object
Generates a cancel request for a given schedule message
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/karafka/web/pro/ui/controllers/scheduled_messages/messages_controller.rb', line 26 def cancel(topic_id, partition_id, ) # Fetches the message we want to cancel to get its key = Karafka::Admin.read_topic( topic_id, partition_id, 1, ).first = ::Karafka::Pro::ScheduledMessages.cancel( key: .key, envelope: { topic: topic_id, partition: partition_id } ) Karafka::Web.producer.produce_sync() redirect( :back, success: <<~MESSAGE A scheduled message with offset #{} from #{topic_id} partition #{partition_id} had a cancel request message successfully created. MESSAGE ) end |