Conduit SQS subscriber implementation not calling my callback

Good afternoon peoples.

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

What am I doing wrong?
thanks.

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

Thanks for the information. But it did not work the envs are listing in that context.

I m:
IO.puts(System.get_env(“AWS_SQS_NAME_QUEUE”))

What do your logs say?

EDIT: You don’t appear to be using the logger that comes with conduit. Set this up and it’ll likely be more obvious something is going wrong. conduit_sqs_example/lib/conduit_sqs_example_queue/broker.ex at master · conduitframework/conduit_sqs_example · GitHub

Also, the following is going to raise an exception. You should be calling inspect/1 on the message before sending it to logger.

Take a look at this: https://github.com/conduitframework/conduit_sqs_example