-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename project & clean up cruft for github push
- Loading branch information
1 parent
a62390a
commit 9e3937d
Showing
67 changed files
with
537 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/ebin | ||
/deps | ||
erl_crash.dump | ||
*.ez |
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,13 @@ | ||
elixir_amqp_consumer | ||
==================== | ||
# elixir_amqp_consumer | ||
|
||
A simple first effort at an Elixir based RabbitMQ consumer | ||
|
||
### To start the server | ||
|
||
Start iex shell and fire up the server | ||
|
||
~~~~~elixir | ||
iex -S mix | ||
{ :ok, pid } = :gen_server.start_link(ElixirAmqpConsumer.Server, 100, []) | ||
~~~~~ | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,16 @@ | ||
{application,amqp_client, | ||
[{description,"RabbitMQ AMQP Client"}, | ||
{vsn,"3.1.3"}, | ||
{modules,[amqp_auth_mechanisms,amqp_channel,amqp_channel_sup, | ||
amqp_channel_sup_sup,amqp_channels_manager, | ||
amqp_client,amqp_connection,amqp_connection_sup, | ||
amqp_connection_type_sup,amqp_direct_connection, | ||
amqp_direct_consumer,amqp_gen_connection, | ||
amqp_gen_consumer,amqp_main_reader, | ||
amqp_network_connection,amqp_rpc_client, | ||
amqp_rpc_server,amqp_selective_consumer,amqp_sup, | ||
amqp_uri,rabbit_routing_util,uri_parser]}, | ||
{registered,[amqp_sup]}, | ||
{env,[{prefer_ipv6,false}]}, | ||
{mod,{amqp_client,[]}}, | ||
{applications,[kernel,stdlib]}]}. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,56 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License at | ||
%% http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | ||
%% License for the specific language governing rights and limitations | ||
%% under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-ifndef(AMQP_CLIENT_HRL). | ||
-define(AMQP_CLIENT_HRL, true). | ||
|
||
-include_lib("rabbit_common/include/rabbit.hrl"). | ||
-include_lib("rabbit_common/include/rabbit_framing.hrl"). | ||
|
||
-record(amqp_msg, {props = #'P_basic'{}, payload = <<>>}). | ||
|
||
-record(amqp_params_network, {username = <<"guest">>, | ||
password = <<"guest">>, | ||
virtual_host = <<"/">>, | ||
host = "localhost", | ||
port = undefined, | ||
channel_max = 0, | ||
frame_max = 0, | ||
heartbeat = 0, | ||
connection_timeout = infinity, | ||
ssl_options = none, | ||
auth_mechanisms = | ||
[fun amqp_auth_mechanisms:plain/3, | ||
fun amqp_auth_mechanisms:amqplain/3], | ||
client_properties = [], | ||
socket_options = []}). | ||
|
||
-record(amqp_params_direct, {username = <<"guest">>, | ||
password = none, | ||
virtual_host = <<"/">>, | ||
node = node(), | ||
adapter_info = none, | ||
client_properties = []}). | ||
|
||
-record(amqp_adapter_info, {host = unknown, | ||
port = unknown, | ||
peer_host = unknown, | ||
peer_port = unknown, | ||
name = unknown, | ||
protocol = unknown, | ||
additional_info = []}). | ||
|
||
-endif. |
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,34 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License at | ||
%% http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | ||
%% License for the specific language governing rights and limitations | ||
%% under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-include("amqp_client.hrl"). | ||
|
||
-define(PROTOCOL_VERSION_MAJOR, 0). | ||
-define(PROTOCOL_VERSION_MINOR, 9). | ||
-define(PROTOCOL_HEADER, <<"AMQP", 0, 0, 9, 1>>). | ||
-define(PROTOCOL, rabbit_framing_amqp_0_9_1). | ||
|
||
-define(MAX_CHANNEL_NUMBER, 65535). | ||
|
||
-define(LOG_DEBUG(Format), error_logger:info_msg(Format)). | ||
-define(LOG_INFO(Format, Args), error_logger:info_msg(Format, Args)). | ||
-define(LOG_WARN(Format, Args), error_logger:warning_msg(Format, Args)). | ||
-define(LOG_ERR(Format, Args), error_logger:error_msg(Format, Args)). | ||
|
||
-define(CLIENT_CAPABILITIES, [{<<"publisher_confirms">>, bool, true}, | ||
{<<"exchange_exchange_bindings">>, bool, true}, | ||
{<<"basic.nack">>, bool, true}, | ||
{<<"consumer_cancel_notify">>, bool, true}]). |
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,42 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License at | ||
%% http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | ||
%% License for the specific language governing rights and limitations | ||
%% under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2011-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-include("amqp_client.hrl"). | ||
|
||
-ifndef(edoc). | ||
-type(state() :: any()). | ||
-type(consume() :: #'basic.consume'{}). | ||
-type(consume_ok() :: #'basic.consume_ok'{}). | ||
-type(cancel() :: #'basic.cancel'{}). | ||
-type(cancel_ok() :: #'basic.cancel_ok'{}). | ||
-type(deliver() :: #'basic.deliver'{}). | ||
-type(from() :: any()). | ||
-type(reason() :: any()). | ||
-type(ok_error() :: {ok, state()} | {error, reason(), state()}). | ||
|
||
-spec(init/1 :: ([any()]) -> {ok, state()}). | ||
-spec(handle_consume/3 :: (consume(), pid(), state()) -> ok_error()). | ||
-spec(handle_consume_ok/3 :: (consume_ok(), consume(), state()) -> | ||
ok_error()). | ||
-spec(handle_cancel/2 :: (cancel(), state()) -> ok_error()). | ||
-spec(handle_cancel_ok/3 :: (cancel_ok(), cancel(), state()) -> ok_error()). | ||
-spec(handle_deliver/3 :: (deliver(), #amqp_msg{}, state()) -> ok_error()). | ||
-spec(handle_info/2 :: (any(), state()) -> ok_error()). | ||
-spec(handle_call/3 :: (any(), from(), state()) -> | ||
{reply, any(), state()} | {noreply, state()} | | ||
{error, reason(), state()}). | ||
-spec(terminate/2 :: (any(), state()) -> state()). | ||
-endif. |
24 changes: 24 additions & 0 deletions
24
deps/amqp_client-3.1.3/include/rabbit_routing_prefixes.hrl
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,24 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License | ||
%% at http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | ||
%% the License for the specific language governing rights and | ||
%% limitations under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2011-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-define(QUEUE_PREFIX, "/queue"). | ||
-define(TOPIC_PREFIX, "/topic"). | ||
-define(EXCHANGE_PREFIX, "/exchange"). | ||
-define(AMQQUEUE_PREFIX, "/amq/queue"). | ||
-define(TEMP_QUEUE_PREFIX, "/temp-queue"). | ||
%% reply queues names can have slashes in the content so no further | ||
%% parsing happens. | ||
-define(REPLY_QUEUE_PREFIX, "/reply-queue/"). |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,18 @@ | ||
{application,rabbit_common, | ||
[{description,"RabbitMQ Common Libraries"}, | ||
{vsn,"3.1.3"}, | ||
{modules,[app_utils,pmon,gen_server2,mirrored_supervisor, | ||
priority_queue,rabbit_backing_queue,rabbit_basic, | ||
rabbit_binary_generator,rabbit_binary_parser, | ||
rabbit_channel,rabbit_runtime_parameter, | ||
rabbit_command_assembler,rabbit_exchange_type, | ||
rabbit_exchange_decorator,rabbit_auth_backend, | ||
rabbit_auth_mechanism,rabbit_framing_amqp_0_8, | ||
rabbit_framing_amqp_0_9_1,rabbit_heartbeat, | ||
rabbit_misc,rabbit_msg_store_index,rabbit_net, | ||
rabbit_nodes,rabbit_policy_validator,rabbit_reader, | ||
rabbit_writer,rabbit_event,rabbit_queue_collector, | ||
rabbit_amqqueue,supervisor2]}, | ||
{registered,[]}, | ||
{env,[]}, | ||
{applications,[kernel,stdlib]}]}. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License at | ||
%% http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | ||
%% License for the specific language governing rights and limitations | ||
%% under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-ifdef(use_specs). | ||
|
||
-type(callback_result() :: 'ok' | {'stop', any()} | {'become', atom(), args()}). | ||
-type(args() :: any()). | ||
-type(members() :: [pid()]). | ||
|
||
-spec(joined/2 :: (args(), members()) -> callback_result()). | ||
-spec(members_changed/3 :: (args(), members(), members()) -> callback_result()). | ||
-spec(handle_msg/3 :: (args(), pid(), any()) -> callback_result()). | ||
-spec(terminate/2 :: (args(), term()) -> any()). | ||
|
||
-endif. |
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,110 @@ | ||
%% The contents of this file are subject to the Mozilla Public License | ||
%% Version 1.1 (the "License"); you may not use this file except in | ||
%% compliance with the License. You may obtain a copy of the License | ||
%% at http://www.mozilla.org/MPL/ | ||
%% | ||
%% Software distributed under the License is distributed on an "AS IS" | ||
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | ||
%% the License for the specific language governing rights and | ||
%% limitations under the License. | ||
%% | ||
%% The Original Code is RabbitMQ. | ||
%% | ||
%% The Initial Developer of the Original Code is VMware, Inc. | ||
%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved. | ||
%% | ||
|
||
-record(user, {username, | ||
tags, | ||
auth_backend, %% Module this user came from | ||
impl %% Scratch space for that module | ||
}). | ||
|
||
-record(internal_user, {username, password_hash, tags}). | ||
-record(permission, {configure, write, read}). | ||
-record(user_vhost, {username, virtual_host}). | ||
-record(user_permission, {user_vhost, permission}). | ||
|
||
-record(vhost, {virtual_host, dummy}). | ||
|
||
-record(content, | ||
{class_id, | ||
properties, %% either 'none', or a decoded record/tuple | ||
properties_bin, %% either 'none', or an encoded properties binary | ||
%% Note: at most one of properties and properties_bin can be | ||
%% 'none' at once. | ||
protocol, %% The protocol under which properties_bin was encoded | ||
payload_fragments_rev %% list of binaries, in reverse order (!) | ||
}). | ||
|
||
-record(resource, {virtual_host, kind, name}). | ||
|
||
-record(exchange, {name, type, durable, auto_delete, internal, arguments, | ||
scratches, policy, decorators}). | ||
-record(exchange_serial, {name, next}). | ||
|
||
-record(amqqueue, {name, durable, auto_delete, exclusive_owner = none, | ||
arguments, pid, slave_pids, sync_slave_pids, policy, | ||
gm_pids}). | ||
|
||
%% mnesia doesn't like unary records, so we add a dummy 'value' field | ||
-record(route, {binding, value = const}). | ||
-record(reverse_route, {reverse_binding, value = const}). | ||
|
||
-record(binding, {source, key, destination, args = []}). | ||
-record(reverse_binding, {destination, key, source, args = []}). | ||
|
||
-record(topic_trie_node, {trie_node, edge_count, binding_count}). | ||
-record(topic_trie_edge, {trie_edge, node_id}). | ||
-record(topic_trie_binding, {trie_binding, value = const}). | ||
|
||
-record(trie_node, {exchange_name, node_id}). | ||
-record(trie_edge, {exchange_name, node_id, word}). | ||
-record(trie_binding, {exchange_name, node_id, destination}). | ||
|
||
-record(listener, {node, protocol, host, ip_address, port}). | ||
|
||
-record(runtime_parameters, {key, value}). | ||
|
||
-record(basic_message, {exchange_name, routing_keys = [], content, id, | ||
is_persistent}). | ||
|
||
-record(ssl_socket, {tcp, ssl}). | ||
-record(delivery, {mandatory, sender, message, msg_seq_no}). | ||
-record(amqp_error, {name, explanation = "", method = none}). | ||
|
||
-record(event, {type, props, timestamp}). | ||
|
||
-record(message_properties, {expiry, needs_confirming = false}). | ||
|
||
-record(plugin, {name, %% atom() | ||
version, %% string() | ||
description, %% string() | ||
type, %% 'ez' or 'dir' | ||
dependencies, %% [{atom(), string()}] | ||
location}). %% string() | ||
|
||
%%---------------------------------------------------------------------------- | ||
|
||
-define(COPYRIGHT_MESSAGE, "Copyright (C) 2007-2013 VMware, Inc."). | ||
-define(INFORMATION_MESSAGE, "Licensed under the MPL. See http://www.rabbitmq.com/"). | ||
-define(ERTS_MINIMUM, "5.6.3"). | ||
|
||
%% EMPTY_FRAME_SIZE, 8 = 1 + 2 + 4 + 1 | ||
%% - 1 byte of frame type | ||
%% - 2 bytes of channel number | ||
%% - 4 bytes of frame payload length | ||
%% - 1 byte of payload trailer FRAME_END byte | ||
%% See rabbit_binary_generator:check_empty_frame_size/0, an assertion | ||
%% called at startup. | ||
-define(EMPTY_FRAME_SIZE, 8). | ||
|
||
-define(MAX_WAIT, 16#ffffffff). | ||
|
||
-define(HIBERNATE_AFTER_MIN, 1000). | ||
-define(DESIRED_HIBERNATE, 10000). | ||
-define(CREDIT_DISC_BOUND, {2000, 500}). | ||
|
||
-define(INVALID_HEADERS_KEY, <<"x-invalid-headers">>). | ||
-define(ROUTING_HEADERS, [<<"CC">>, <<"BCC">>]). | ||
-define(DELETED_HEADER, <<"BCC">>). |
Oops, something went wrong.