-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7530848
commit 078c34c
Showing
9 changed files
with
57 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
import Config | ||
|
||
config :coney, | ||
topology: %{ | ||
exchanges: [{:topic, "exchange", durable: false}], | ||
queues: %{ | ||
"queue" => %{ | ||
options: [ | ||
durable: false | ||
], | ||
bindings: [ | ||
[exchange: "exchange", options: [routing_key: "queue"]] | ||
] | ||
} | ||
} | ||
}, | ||
pool_size: 1, | ||
auto_start: true, | ||
settings: %{ | ||
url: "amqp://guest:guest@localhost:5672", | ||
timeout: 1000 | ||
}, | ||
workers: [ | ||
FakeConsumer | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
defmodule FakeConsumer do | ||
defmodule Coney.FakeConsumer do | ||
@behaviour Coney.Consumer | ||
|
||
def connection do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
defmodule Coney.OtherFakeConsumer do | ||
@behaviour Coney.Consumer | ||
|
||
def connection do | ||
%{ | ||
prefetch_count: 10, | ||
queue: "queue" | ||
} | ||
end | ||
|
||
def parse(payload, _meta) do | ||
payload | ||
end | ||
|
||
def process(payload, _meta) do | ||
case payload do | ||
:ok -> :ok | ||
:reject -> :reject | ||
:reply -> {:reply, :data} | ||
:exception -> raise "Exception happen" | ||
_other -> :ok | ||
end | ||
end | ||
|
||
def error_happened(_exception, _payload, _meta) do | ||
:ok | ||
end | ||
end |