Is it possible to use message Pact for ActiveSupport::Notification messages?

118 Views Asked by At

Message Pact is non Http approach, see for more details: https://docs.pact.io/getting_started/how_pact_works#non-http-testing-message-pact

ActiveSupport::Notification - is part of [Rails ActiveSupport][1], see for more details: https://apidock.com/rails/ActiveSupport/Notifications

As I understand, ActiveSupport::Notification is using memory for a queue underneath, but not the external requests that are expected by Pact, so probably it can be done only via some other Message Queue, like Kafka, for example:

ActiveSupport::Notifications.subscribe("my_message") do |payload|
  Kafka.produce(queue: 'test-queue', message: payload)
end

where Kafka.produce can be handled by Pact.

However, in this way, there is makes sense to remove ActiveSupport::Notifications and keep using only Kafka but this is the next step.

0

There are 0 best solutions below