I’m here with the conduct-sqs subscriber implementation.
He’s not calling my callback.
My setup is broken like this:
configure do
queue System.get_env("AWS_SQS_NAME_QUEUE")
end
incoming MyappWebQueue do
subscribe :message, GenSubscriber, from: System.get_env("AWS_SQS_NAME_QUEUE")
end
Implements MyappWebQueue.
defmodule MyappWebQueue.GenSubscriber do
use Conduit.Subscriber
require Logger
def process(message, _opts) do
# Code to process the message
Logger.info(message)
message
end
end
The System.get_env/1 calls are going to be executed at compile time rather than runtime the way you’re doing it. Pass a function instead.
configure do
queue fn -> System.get_env(“AWS_SQS_NAME_QUEUE”) end
end
incoming MyappWebQueue do
subscribe :message, GenSubscriber, from: fn -> System.get_env(“AWS_SQS_NAME_QUEUE”) end
end