You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to demo Circuitry in my app, so using the config in the example app
I created a file circuitry.rb in the initializers folder, it has the following content as copied from the example app
require 'circuitry'
Circuitry.publisher_config do |c|
c.access_key = ENV.fetch('AWS_ACCESS_KEY')
c.secret_key = ENV.fetch('AWS_SECRET_KEY')
c.region = ENV.fetch('AWS_REGION')
c.logger = Rails.logger
c.async_strategy = :thread
c.on_async_exit = proc do
puts 'Publisher done.'
end
# list of topics that will be published to
c.topic_names = %w[
example-circuitry-topic
]
end
Circuitry.subscriber_config do |c|
c.access_key = ENV.fetch('AWS_ACCESS_KEY')
c.secret_key = ENV.fetch('AWS_SECRET_KEY')
c.region = ENV.fetch('AWS_REGION')
c.async_strategy = :thread
c.on_async_exit = proc do
puts 'Subscriber done.'
end
c.queue_name = 'example-circuitry-queue'
# list of topics that the queue should subscribe to
c.topic_names = %w[
example-circuitry-topic
]
end
created these 2 other files in the config folder
subscriber.rb
require_relative './initializers/circuitry'
Circuitry.subscribe(async: true) do |message, topic|
puts "Received: #{topic}: #{message.inspect}"
end
and publisher.rb
require_relative './initializers/circuitry'
topic = 'example-circuitry-topic'
10.times do |n|
# `object` can be anything that responds to `#to_json`.
object = { foo: 'bar', fizz: 'buzz', n: n }
Circuitry.publish(topic, object, async: true)
end
Circuitry.flush
My app is not stating up because of this error and I have no idea how to fix.
web_1 | rake aborted!
web_1 | NoMethodError: undefined method `publisher_config' for Circuitry:Module
web_1 | Did you mean? public_send
web_1 | /conectar/config/initializers/circuitry.rb:3:in `<main>'
Any idea how to fix this error?
The text was updated successfully, but these errors were encountered:
Trying to demo Circuitry in my app, so using the config in the example app
I created a file circuitry.rb in the initializers folder, it has the following content as copied from the example app
created these 2 other files in the config folder
subscriber.rb
and publisher.rb
My app is not stating up because of this error and I have no idea how to fix.
Any idea how to fix this error?
The text was updated successfully, but these errors were encountered: