fireproofsocks

fireproofsocks

Using ExAws with ElasticMQ

I was wondering if there were any examples floating around for how to use ElasticMQ with Elixir’s ExAws and ExAws.SQS modules. There was one related post I found here: Use Broadway with ElasticMQ in docker but the usage was constrained to Broadway. Although I may end up using Broadway, I’d like to know how to manually insert and remove messages from queues in a local (i.e. Dockerized) instance of ElasticMQ.

Generally, I’d like to execute commands like this against the local ElasticMQ instance:

"123/my_q"
|> ExAws.SQS.create_queue()
|> ExAws.request()

This generates errors, however, depending on how I have my configuration set up, e.g.

03:03:50.385 erl_level=warning application=ex_aws domain=elixir file=lib/ex_aws/request.ex function=request_and_retry/7 line=80 mfa=ExAws.Request.request_and_retry/7 module=ExAws.Request pid=<0.487.0> [warning] ExAws: HTTP ERROR: :timeout for URL: "https:/" ATTEMPT: 1

or

You tried to access the AWS EC2 instance meta, but it could not be reached.
This happens most often when trying to access it from your local computer,
which happens when environment variables are not set correctly prompting
ExAws to fallback to the Instance Meta.

This is the configuration I have tried:

config :ex_aws,
  access_key_id: "x",
  security_token: "x",
  secret_access_key: "x",
  host: "localhost",
  port: "9324",
  scheme: "http://",
  region: "elasticmq"

I have not tried supplying a configuration file to the ElasticMQ instance.

If anyone has any pointers on how to access this service I would appreciate them!

First Post!

joaodubas

joaodubas

To access the elasticmq instace, I used the following configuration:

config :ex_aws,
  access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
  secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role],
  region: "elasticmq"

config :ex_aws, :sqs,
  scheme: "http://",
  host: System.get_env("AWS_DOMAIN", "localhost"),
  port: 9324,
  region: "elasticmq"

Where Next?

Popular in Questions Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New

We're in Beta

About us Mission Statement