diff --git a/deps/rabbit/src/rabbit_framing.erl b/deps/rabbit/src/rabbit_framing.erl index f4518eb6e754..47a455e09df3 100644 --- a/deps/rabbit/src/rabbit_framing.erl +++ b/deps/rabbit/src/rabbit_framing.erl @@ -16,10 +16,9 @@ amqp_method_field_name/0, amqp_property_record/0, amqp_exception/0, amqp_exception_code/0, amqp_class_id/0]). --type protocol() :: 'rabbit_framing_amqp_0_8' | 'rabbit_framing_amqp_0_9_1'. +-type protocol() :: 'rabbit_framing_amqp_0_9_1'. --define(protocol_type(T), type(T :: rabbit_framing_amqp_0_8:T | - rabbit_framing_amqp_0_9_1:T)). +-define(protocol_type(T), type(T :: rabbit_framing_amqp_0_9_1:T)). -?protocol_type(amqp_field_type()). -?protocol_type(amqp_property_type()). diff --git a/deps/rabbit/src/rabbit_reader.erl b/deps/rabbit/src/rabbit_reader.erl index 14aace49f792..8f1c0db96757 100644 --- a/deps/rabbit/src/rabbit_reader.erl +++ b/deps/rabbit/src/rabbit_reader.erl @@ -1067,17 +1067,6 @@ handshake({0, 0, 9, 1}, State) -> handshake({1, 1, 0, 9}, State) -> start_connection({0, 9, 0}, rabbit_framing_amqp_0_9_1, State); -%% This is what most clients send for 0-8. The 0-8 spec, confusingly, -%% defines the version as 8-0. -handshake({1, 1, 8, 0}, State) -> - start_connection({8, 0, 0}, rabbit_framing_amqp_0_8, State); - -%% The 0-8 spec as on the AMQP web site actually has this as the -%% protocol header; some libraries e.g., py-amqplib, send it when they -%% want 0-8. -handshake({1, 1, 9, 1}, State) -> - start_connection({8, 0, 0}, rabbit_framing_amqp_0_8, State); - %% ... and finally, the 1.0 spec is crystal clear! handshake({Id, 1, 0, 0}, State) -> become_1_0(Id, State); @@ -1123,9 +1112,9 @@ ensure_stats_timer(State) -> %%-------------------------------------------------------------------------- handle_method0(MethodName, FieldsBin, - State = #v1{connection = #connection{protocol = Protocol}}) -> + State = #v1{connection = #connection{}}) -> try - handle_method0(Protocol:decode_method_fields(MethodName, FieldsBin), + handle_method0(rabbit_framing_amqp_0_9_1:decode_method_fields(MethodName, FieldsBin), State) catch throw:{inet_error, E} when E =:= closed; E =:= enotconn -> maybe_emit_stats(State), diff --git a/deps/rabbit/test/unit_amqp091_content_framing_SUITE.erl b/deps/rabbit/test/unit_amqp091_content_framing_SUITE.erl index 61e004f10de6..d4fc37457ba3 100644 --- a/deps/rabbit/test/unit_amqp091_content_framing_SUITE.erl +++ b/deps/rabbit/test/unit_amqp091_content_framing_SUITE.erl @@ -172,8 +172,7 @@ content_transcoding(_Config) -> sequence_with_content([ClearEncoded, Op]), sequence_with_content([ClearDecoded, Op]) end || Op <- [ClearDecoded, ClearEncoded, EnsureDecoded, - EnsureEncoded(rabbit_framing_amqp_0_9_1), - EnsureEncoded(rabbit_framing_amqp_0_8)]], + EnsureEncoded(rabbit_framing_amqp_0_9_1)]], passed. sequence_with_content(Sequence) -> diff --git a/deps/rabbit_common/.gitignore b/deps/rabbit_common/.gitignore index f609631433e1..e233f29d1ee8 100644 --- a/deps/rabbit_common/.gitignore +++ b/deps/rabbit_common/.gitignore @@ -26,6 +26,3 @@ /rabbit_common.d # Generated source files. -/include/rabbit_framing.hrl -/src/rabbit_framing_amqp_0_8.erl -/src/rabbit_framing_amqp_0_9_1.erl diff --git a/deps/rabbit_common/BUILD.bazel b/deps/rabbit_common/BUILD.bazel index 089231b2b2dd..21e23b70f3bf 100644 --- a/deps/rabbit_common/BUILD.bazel +++ b/deps/rabbit_common/BUILD.bazel @@ -12,49 +12,38 @@ load( "rabbitmq_suite", ) -py_binary( - name = "codegen", - srcs = [ - "codegen.py", - ], - imports = ["../../deps/rabbitmq_codegen"], - deps = [ - "//deps/rabbitmq_codegen:amqp_codegen", - ], -) - -genrule( - name = "generated_headers", - srcs = [ - "//deps/rabbitmq_codegen:amqp-rabbitmq-0.9.1.json", - "//deps/rabbitmq_codegen:credit_extension.json", - "//deps/rabbitmq_codegen:amqp-rabbitmq-0.8.json", - ], - outs = ["include/rabbit_framing.hrl"], - cmd = "$(location :codegen) --ignore-conflicts header $(SRCS) $@", - tools = [":codegen"], -) - -genrule( - name = "rabbit_framing_amqp_0_9_1.erl", - srcs = [ - "//deps/rabbitmq_codegen:amqp-rabbitmq-0.9.1.json", - "//deps/rabbitmq_codegen:credit_extension.json", - ], - outs = ["src/rabbit_framing_amqp_0_9_1.erl"], - cmd = "$(location :codegen) body $(SRCS) $@", - tools = [":codegen"], -) - -genrule( - name = "rabbit_framing_amqp_0_8.erl", - srcs = [ - "//deps/rabbitmq_codegen:amqp-rabbitmq-0.8.json", - ], - outs = ["src/rabbit_framing_amqp_0_8.erl"], - cmd = "$(location :codegen) body $(SRCS) $@", - tools = [":codegen"], -) +# py_binary( +# name = "codegen", +# srcs = [ +# "codegen.py", +# ], +# imports = ["../../deps/rabbitmq_codegen"], +# deps = [ +# "//deps/rabbitmq_codegen:amqp_codegen", +# ], +# ) + +# genrule( +# name = "generated_headers", +# srcs = [ +# "//deps/rabbitmq_codegen:amqp-rabbitmq-0.9.1.json", +# "//deps/rabbitmq_codegen:credit_extension.json", +# ], +# outs = ["include/rabbit_framing.hrl"], +# cmd = "$(location :codegen) --ignore-conflicts header $(SRCS) $@", +# tools = [":codegen"], +# ) + +# genrule( +# name = "rabbit_framing_amqp_0_9_1.erl", +# srcs = [ +# "//deps/rabbitmq_codegen:amqp-rabbitmq-0.9.1.json", +# "//deps/rabbitmq_codegen:credit_extension.json", +# ], +# outs = ["src/rabbit_framing_amqp_0_9_1.erl"], +# cmd = "$(location :codegen) body $(SRCS) $@", +# tools = [":codegen"], +# ) DEPS = [] @@ -98,7 +87,7 @@ EXTRA_APPS = [ "xmerl", ] -HDRS = glob(["include/*.hrl"]) + ["include/rabbit_framing.hrl"] +HDRS = glob(["include/*.hrl"]) app_file( name = "app_file", @@ -115,10 +104,7 @@ erlc( name = "beam_files", srcs = glob( ["src/*.erl"], - ) + [ - "src/rabbit_framing_amqp_0_8.erl", - "src/rabbit_framing_amqp_0_9_1.erl", - ], + ), hdrs = HDRS, dest = "ebin", erlc_opts = RABBITMQ_ERLC_OPTS, @@ -142,10 +128,7 @@ erlc( testonly = True, srcs = glob( ["src/*.erl"], - ) + [ - "src/rabbit_framing_amqp_0_8.erl", - "src/rabbit_framing_amqp_0_9_1.erl", - ], + ), hdrs = HDRS, dest = "src", erlc_opts = RABBITMQ_TEST_ERLC_OPTS, diff --git a/deps/rabbit_common/development.post.mk b/deps/rabbit_common/development.post.mk index ec905a46158f..576604c6219c 100644 --- a/deps/rabbit_common/development.post.mk +++ b/deps/rabbit_common/development.post.mk @@ -7,27 +7,16 @@ CODEGEN = $(CURDIR)/codegen.py CODEGEN_DIR ?= $(DEPS_DIR)/rabbitmq_codegen CODEGEN_AMQP = $(CODEGEN_DIR)/amqp_codegen.py -AMQP_SPEC_JSON_FILES_0_8 = $(CODEGEN_DIR)/amqp-rabbitmq-0.8.json AMQP_SPEC_JSON_FILES_0_9_1 = $(CODEGEN_DIR)/amqp-rabbitmq-0.9.1.json \ $(CODEGEN_DIR)/credit_extension.json include/rabbit_framing.hrl:: $(CODEGEN) $(CODEGEN_AMQP) \ - $(AMQP_SPEC_JSON_FILES_0_9_1) $(AMQP_SPEC_JSON_FILES_0_8) + $(AMQP_SPEC_JSON_FILES_0_9_1) $(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \ $(PYTHON) $(CODEGEN) --ignore-conflicts header \ - $(AMQP_SPEC_JSON_FILES_0_9_1) $(AMQP_SPEC_JSON_FILES_0_8) $@ + $(AMQP_SPEC_JSON_FILES_0_9_1) $@ src/rabbit_framing_amqp_0_9_1.erl:: $(CODEGEN) $(CODEGEN_AMQP) \ $(AMQP_SPEC_JSON_FILES_0_9_1) $(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \ $(PYTHON) $(CODEGEN) body $(AMQP_SPEC_JSON_FILES_0_9_1) $@ - -src/rabbit_framing_amqp_0_8.erl:: $(CODEGEN) $(CODEGEN_AMQP) \ - $(AMQP_SPEC_JSON_FILES_0_8) - $(gen_verbose) env PYTHONPATH=$(CODEGEN_DIR) \ - $(PYTHON) $(CODEGEN) body $(AMQP_SPEC_JSON_FILES_0_8) $@ - -clean:: clean-extra-sources - -clean-extra-sources: - $(gen_verbose) rm -f $(EXTRA_SOURCES) diff --git a/deps/rabbit_common/development.pre.mk b/deps/rabbit_common/development.pre.mk index 0b11877df30d..d282b70d9753 100644 --- a/deps/rabbit_common/development.pre.mk +++ b/deps/rabbit_common/development.pre.mk @@ -6,9 +6,15 @@ BUILD_DEPS = rabbitmq_codegen TEST_DEPS = proper -EXTRA_SOURCES += include/rabbit_framing.hrl \ - src/rabbit_framing_amqp_0_8.erl \ - src/rabbit_framing_amqp_0_9_1.erl +CODEGEN_SOURCES += include/rabbit_framing.hrl \ + src/rabbit_framing_amqp_0_9_1.erl + +codegen-clean: + $(gen_verbose) rm -f $(CODEGEN_SOURCES) + +codegen: codegen-clean + $(CODEGEN_SOURCES) + +.PHONY: codegen codegen-clean -.DEFAULT_GOAL = all $(PROJECT).d:: $(EXTRA_SOURCES) diff --git a/deps/rabbit_common/include/rabbit_framing.hrl b/deps/rabbit_common/include/rabbit_framing.hrl new file mode 100644 index 000000000000..3d10b39acc0d --- /dev/null +++ b/deps/rabbit_common/include/rabbit_framing.hrl @@ -0,0 +1,113 @@ +%% Autogenerated code. Do not edit. +%% +%% This Source Code Form is subject to the terms of the Mozilla Public +%% License, v. 2.0. If a copy of the MPL was not distributed with this +%% file, You can obtain one at https://mozilla.org/MPL/2.0/. +%% +%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +%% +-define(PROTOCOL_PORT, 5672). +-define(FRAME_METHOD, 1). +-define(FRAME_HEADER, 2). +-define(FRAME_BODY, 3). +-define(FRAME_HEARTBEAT, 8). +-define(FRAME_MIN_SIZE, 4096). +-define(FRAME_END, 206). +-define(REPLY_SUCCESS, 200). +-define(CONTENT_TOO_LARGE, 311). +-define(NO_ROUTE, 312). +-define(NO_CONSUMERS, 313). +-define(ACCESS_REFUSED, 403). +-define(NOT_FOUND, 404). +-define(RESOURCE_LOCKED, 405). +-define(PRECONDITION_FAILED, 406). +-define(CONNECTION_FORCED, 320). +-define(INVALID_PATH, 402). +-define(FRAME_ERROR, 501). +-define(SYNTAX_ERROR, 502). +-define(COMMAND_INVALID, 503). +-define(CHANNEL_ERROR, 504). +-define(UNEXPECTED_FRAME, 505). +-define(RESOURCE_ERROR, 506). +-define(NOT_ALLOWED, 530). +-define(NOT_IMPLEMENTED, 540). +-define(INTERNAL_ERROR, 541). +%% Method field records. +-record('basic.qos', {prefetch_size = 0, prefetch_count = 0, global = false}). +-record('basic.qos_ok', {}). +-record('basic.consume', {ticket = 0, queue = <<"">>, consumer_tag = <<"">>, no_local = false, no_ack = false, exclusive = false, nowait = false, arguments = []}). +-record('basic.consume_ok', {consumer_tag}). +-record('basic.cancel', {consumer_tag, nowait = false}). +-record('basic.cancel_ok', {consumer_tag}). +-record('basic.publish', {ticket = 0, exchange = <<"">>, routing_key = <<"">>, mandatory = false, immediate = false}). +-record('basic.return', {reply_code, reply_text = <<"">>, exchange, routing_key}). +-record('basic.deliver', {consumer_tag, delivery_tag, redelivered = false, exchange, routing_key}). +-record('basic.get', {ticket = 0, queue = <<"">>, no_ack = false}). +-record('basic.get_ok', {delivery_tag, redelivered = false, exchange, routing_key, message_count}). +-record('basic.get_empty', {cluster_id = <<"">>}). +-record('basic.ack', {delivery_tag = 0, multiple = false}). +-record('basic.reject', {delivery_tag, requeue = true}). +-record('basic.recover_async', {requeue = false}). +-record('basic.recover', {requeue = false}). +-record('basic.recover_ok', {}). +-record('basic.nack', {delivery_tag = 0, multiple = false, requeue = true}). +-record('basic.credit', {consumer_tag = <<"">>, credit, drain}). +-record('basic.credit_ok', {available}). +-record('basic.credit_drained', {consumer_tag = <<"">>, credit_drained}). +-record('connection.start', {version_major = 0, version_minor = 9, server_properties, mechanisms = <<"PLAIN">>, locales = <<"en_US">>}). +-record('connection.start_ok', {client_properties, mechanism = <<"PLAIN">>, response, locale = <<"en_US">>}). +-record('connection.secure', {challenge}). +-record('connection.secure_ok', {response}). +-record('connection.tune', {channel_max = 0, frame_max = 0, heartbeat = 0}). +-record('connection.tune_ok', {channel_max = 0, frame_max = 0, heartbeat = 0}). +-record('connection.open', {virtual_host = <<"/">>, capabilities = <<"">>, insist = false}). +-record('connection.open_ok', {known_hosts = <<"">>}). +-record('connection.close', {reply_code, reply_text = <<"">>, class_id, method_id}). +-record('connection.close_ok', {}). +-record('connection.blocked', {reason = <<"">>}). +-record('connection.unblocked', {}). +-record('connection.update_secret', {new_secret, reason}). +-record('connection.update_secret_ok', {}). +-record('channel.open', {out_of_band = <<"">>}). +-record('channel.open_ok', {channel_id = <<"">>}). +-record('channel.flow', {active}). +-record('channel.flow_ok', {active}). +-record('channel.close', {reply_code, reply_text = <<"">>, class_id, method_id}). +-record('channel.close_ok', {}). +-record('access.request', {realm = <<"/data">>, exclusive = false, passive = true, active = true, write = true, read = true}). +-record('access.request_ok', {ticket = 1}). +-record('exchange.declare', {ticket = 0, exchange, type = <<"direct">>, passive = false, durable = false, auto_delete = false, internal = false, nowait = false, arguments = []}). +-record('exchange.declare_ok', {}). +-record('exchange.delete', {ticket = 0, exchange, if_unused = false, nowait = false}). +-record('exchange.delete_ok', {}). +-record('exchange.bind', {ticket = 0, destination, source, routing_key = <<"">>, nowait = false, arguments = []}). +-record('exchange.bind_ok', {}). +-record('exchange.unbind', {ticket = 0, destination, source, routing_key = <<"">>, nowait = false, arguments = []}). +-record('exchange.unbind_ok', {}). +-record('queue.declare', {ticket = 0, queue = <<"">>, passive = false, durable = false, exclusive = false, auto_delete = false, nowait = false, arguments = []}). +-record('queue.declare_ok', {queue, message_count, consumer_count}). +-record('queue.bind', {ticket = 0, queue = <<"">>, exchange, routing_key = <<"">>, nowait = false, arguments = []}). +-record('queue.bind_ok', {}). +-record('queue.purge', {ticket = 0, queue = <<"">>, nowait = false}). +-record('queue.purge_ok', {message_count}). +-record('queue.delete', {ticket = 0, queue = <<"">>, if_unused = false, if_empty = false, nowait = false}). +-record('queue.delete_ok', {message_count}). +-record('queue.unbind', {ticket = 0, queue = <<"">>, exchange, routing_key = <<"">>, arguments = []}). +-record('queue.unbind_ok', {}). +-record('tx.select', {}). +-record('tx.select_ok', {}). +-record('tx.commit', {}). +-record('tx.commit_ok', {}). +-record('tx.rollback', {}). +-record('tx.rollback_ok', {}). +-record('confirm.select', {nowait = false}). +-record('confirm.select_ok', {}). +%% Class property records. +-record('P_basic', {content_type, content_encoding, headers, delivery_mode, priority, correlation_id, reply_to, expiration, message_id, timestamp, type, user_id, app_id, cluster_id}). +-record('P_connection', {}). +-record('P_channel', {}). +-record('P_access', {}). +-record('P_exchange', {}). +-record('P_queue', {}). +-record('P_tx', {}). +-record('P_confirm', {}). diff --git a/deps/rabbit_common/src/rabbit_binary_generator.erl b/deps/rabbit_common/src/rabbit_binary_generator.erl index e13ba66969be..870c402c89ca 100644 --- a/deps/rabbit_common/src/rabbit_binary_generator.erl +++ b/deps/rabbit_common/src/rabbit_binary_generator.erl @@ -46,10 +46,10 @@ %%---------------------------------------------------------------------------- -build_simple_method_frame(ChannelInt, MethodRecord, Protocol) -> - MethodFields = Protocol:encode_method_fields(MethodRecord), +build_simple_method_frame(ChannelInt, MethodRecord, rabbit_framing_amqp_0_9_1) -> + MethodFields = rabbit_framing_amqp_0_9_1:encode_method_fields(MethodRecord), MethodName = rabbit_misc:method_record_type(MethodRecord), - {ClassId, MethodId} = Protocol:method_id(MethodName), + {ClassId, MethodId} = rabbit_framing_amqp_0_9_1:method_id(MethodName), create_frame(1, ChannelInt, [<>, MethodFields]). build_simple_content_frames(ChannelInt, Content, FrameMax, Protocol) -> @@ -172,16 +172,15 @@ ensure_content_encoded(Content = #content{properties_bin = PropBin, when PropBin =/= none -> Content; ensure_content_encoded(Content = #content{properties = none, - properties_bin = PropBin, - protocol = Protocol}, Protocol1) + properties_bin = PropBin}, Protocol1) when PropBin =/= none -> - Props = Protocol:decode_properties(Content#content.class_id, PropBin), + Props = rabbit_framing_amqp_0_9_1:decode_properties(Content#content.class_id, PropBin), Content#content{properties = Props, properties_bin = Protocol1:encode_properties(Props), protocol = Protocol1}; ensure_content_encoded(Content = #content{properties = Props}, Protocol) when Props =/= none -> - Content#content{properties_bin = Protocol:encode_properties(Props), + Content#content{properties_bin = rabbit_framing_amqp_0_9_1:encode_properties(Props), protocol = Protocol}. clear_encoded_content(Content = #content{properties_bin = none, @@ -196,13 +195,13 @@ clear_encoded_content(Content = #content{}) -> Content#content{properties_bin = none, protocol = none}. %% NB: this function is also used by the Erlang client -map_exception(Channel, Reason, Protocol) -> +map_exception(Channel, Reason, rabbit_framing_amqp_0_9_1) -> {SuggestedClose, ReplyCode, ReplyText, FailedMethod} = - lookup_amqp_exception(Reason, Protocol), + lookup_amqp_exception(Reason), {ClassId, MethodId} = case FailedMethod of {_, _} -> FailedMethod; none -> {0, 0}; - _ -> Protocol:method_id(FailedMethod) + _ -> rabbit_framing_amqp_0_9_1:method_id(FailedMethod) end, case SuggestedClose orelse (Channel == 0) of true -> {0, #'connection.close'{reply_code = ReplyCode, @@ -217,14 +216,13 @@ map_exception(Channel, Reason, Protocol) -> lookup_amqp_exception(#amqp_error{name = Name, explanation = Expl, - method = Method}, - Protocol) -> - {ShouldClose, Code, Text} = Protocol:lookup_amqp_exception(Name), + method = Method}) -> + {ShouldClose, Code, Text} = rabbit_framing_amqp_0_9_1:lookup_amqp_exception(Name), ExplBin = amqp_exception_explanation(Text, Expl), {ShouldClose, Code, ExplBin, Method}; -lookup_amqp_exception(Other, Protocol) -> +lookup_amqp_exception(Other) -> rabbit_log:warning("Non-AMQP exit reason '~p'", [Other]), - {ShouldClose, Code, Text} = Protocol:lookup_amqp_exception(internal_error), + {ShouldClose, Code, Text} = rabbit_framing_amqp_0_9_1:lookup_amqp_exception(internal_error), {ShouldClose, Code, Text, none}. amqp_exception_explanation(Text, Expl) -> diff --git a/deps/rabbit_common/src/rabbit_binary_parser.erl b/deps/rabbit_common/src/rabbit_binary_parser.erl index 506499d49a52..49cde3431bb1 100644 --- a/deps/rabbit_common/src/rabbit_binary_parser.erl +++ b/deps/rabbit_common/src/rabbit_binary_parser.erl @@ -140,10 +140,9 @@ parse_array(<<$V, Rest/binary>>) -> ensure_content_decoded(Content = #content{properties = Props}) when Props =/= none -> Content; -ensure_content_decoded(Content = #content{properties_bin = PropBin, - protocol = Protocol}) +ensure_content_decoded(Content = #content{properties_bin = PropBin}) when PropBin =/= none -> - Content#content{properties = Protocol:decode_properties( + Content#content{properties = rabbit_framing_amqp_0_9_1:decode_properties( Content#content.class_id, PropBin)}. clear_decoded_content(Content = #content{properties = none}) -> diff --git a/deps/rabbit_common/src/rabbit_command_assembler.erl b/deps/rabbit_common/src/rabbit_command_assembler.erl index 9ef13ee3135c..0c287b48daa0 100644 --- a/deps/rabbit_common/src/rabbit_command_assembler.erl +++ b/deps/rabbit_common/src/rabbit_command_assembler.erl @@ -17,9 +17,10 @@ -export_type([frame/0]). --type frame_type() :: ?FRAME_METHOD | ?FRAME_HEADER | ?FRAME_BODY | - ?FRAME_OOB_METHOD | ?FRAME_OOB_HEADER | ?FRAME_OOB_BODY | - ?FRAME_TRACE | ?FRAME_HEARTBEAT. +-type frame_type() :: ?FRAME_METHOD | ?FRAME_HEADER | ?FRAME_BODY + % ?FRAME_OOB_METHOD | ?FRAME_OOB_HEADER | ?FRAME_OOB_BODY | + % ?FRAME_TRACE + | ?FRAME_HEARTBEAT. -type protocol() :: rabbit_framing:protocol(). -type method() :: rabbit_framing:amqp_method_record(). -type class_id() :: rabbit_framing:amqp_class_id(). @@ -69,10 +70,10 @@ init(Protocol) -> {ok, {method, Protocol}}. process({method, MethodName, FieldsBin}, {method, Protocol}) -> try - Method = Protocol:decode_method_fields(MethodName, FieldsBin), - case Protocol:method_has_content(MethodName) of - true -> {ClassId, _MethodId} = Protocol:method_id(MethodName), - {ok, {content_header, Method, ClassId, Protocol}}; + Method = rabbit_framing_amqp_0_9_1:decode_method_fields(MethodName, FieldsBin), + case rabbit_framing_amqp_0_9_1:method_has_content(MethodName) of + true -> {ClassId, _MethodId} = rabbit_framing_amqp_0_9_1:method_id(MethodName), + {ok, {content_header, Method, ClassId, rabbit_framing_amqp_0_9_1}}; false -> {ok, Method, {method, Protocol}} end catch exit:#amqp_error{} = Reason -> {error, Reason} diff --git a/deps/rabbit_common/src/rabbit_framing_amqp_0_9_1.erl b/deps/rabbit_common/src/rabbit_framing_amqp_0_9_1.erl new file mode 100644 index 000000000000..afb1bfc13c59 --- /dev/null +++ b/deps/rabbit_common/src/rabbit_framing_amqp_0_9_1.erl @@ -0,0 +1,1270 @@ +%% Autogenerated code. Do not edit. +%% +%% This Source Code Form is subject to the terms of the Mozilla Public +%% License, v. 2.0. If a copy of the MPL was not distributed with this +%% file, You can obtain one at https://mozilla.org/MPL/2.0/. +%% +%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +%% +-module(rabbit_framing_amqp_0_9_1). +-include("rabbit_framing.hrl"). + +-export([version/0]). +-export([lookup_method_name/1]). +-export([lookup_class_name/1]). + +-export([method_id/1]). +-export([method_has_content/1]). +-export([is_method_synchronous/1]). +-export([method_record/1]). +-export([method_fieldnames/1]). +-export([decode_method_fields/2]). +-export([decode_properties/2]). +-export([encode_method_fields/1]). +-export([encode_properties/1]). +-export([lookup_amqp_exception/1]). +-export([amqp_exception/1]). + + +%% Various types +-export_type([amqp_field_type/0, amqp_property_type/0, + amqp_table/0, amqp_array/0, amqp_value/0, + amqp_method_name/0, amqp_method/0, amqp_method_record/0, + amqp_method_field_name/0, amqp_property_record/0, + amqp_exception/0, amqp_exception_code/0, amqp_class_id/0]). + +-type amqp_field_type() :: + 'longstr' | 'signedint' | 'decimal' | 'timestamp' | + 'unsignedbyte' | 'unsignedshort' | 'unsignedint' | + 'table' | 'byte' | 'double' | 'float' | 'long' | + 'short' | 'bool' | 'binary' | 'void' | 'array'. +-type amqp_property_type() :: + 'shortstr' | 'longstr' | 'octet' | 'short' | 'long' | + 'longlong' | 'timestamp' | 'bit' | 'table'. + +-type amqp_table() :: [{binary(), amqp_field_type(), amqp_value()}]. +-type amqp_array() :: [{amqp_field_type(), amqp_value()}]. +-type amqp_value() :: binary() | % longstr + integer() | % signedint + {non_neg_integer(), non_neg_integer()} | % decimal + amqp_table() | + amqp_array() | + byte() | % byte + float() | % double + integer() | % long + integer() | % short + boolean() | % bool + binary() | % binary + 'undefined' | % void + non_neg_integer(). % timestamp + +-type amqp_method_name() :: + ( 'basic.qos' | 'basic.qos_ok' | 'basic.consume' | 'basic.consume_ok' + | 'basic.cancel' | 'basic.cancel_ok' | 'basic.publish' | 'basic.return' + | 'basic.deliver' | 'basic.get' | 'basic.get_ok' | 'basic.get_empty' + | 'basic.ack' | 'basic.reject' | 'basic.recover_async' | 'basic.recover' + | 'basic.recover_ok' | 'basic.nack' | 'basic.credit' | 'basic.credit_ok' + | 'basic.credit_drained' | 'connection.start' | 'connection.start_ok' | 'connection.secure' + | 'connection.secure_ok' | 'connection.tune' | 'connection.tune_ok' | 'connection.open' + | 'connection.open_ok' | 'connection.close' | 'connection.close_ok' | 'connection.blocked' + | 'connection.unblocked' | 'connection.update_secret' | 'connection.update_secret_ok' | 'channel.open' + | 'channel.open_ok' | 'channel.flow' | 'channel.flow_ok' | 'channel.close' + | 'channel.close_ok' | 'access.request' | 'access.request_ok' | 'exchange.declare' + | 'exchange.declare_ok' | 'exchange.delete' | 'exchange.delete_ok' | 'exchange.bind' + | 'exchange.bind_ok' | 'exchange.unbind' | 'exchange.unbind_ok' | 'queue.declare' + | 'queue.declare_ok' | 'queue.bind' | 'queue.bind_ok' | 'queue.purge' + | 'queue.purge_ok' | 'queue.delete' | 'queue.delete_ok' | 'queue.unbind' + | 'queue.unbind_ok' | 'tx.select' | 'tx.select_ok' | 'tx.commit' + | 'tx.commit_ok' | 'tx.rollback' | 'tx.rollback_ok' | 'confirm.select' + | 'confirm.select_ok' ). +-type amqp_method() :: + ( {60, 10} | {60, 11} | {60, 20} | {60, 21} | {60, 30} | {60, 31} + | {60, 40} | {60, 50} | {60, 60} | {60, 70} | {60, 71} | {60, 72} + | {60, 80} | {60, 90} | {60, 100} | {60, 110} | {60, 111} | {60, 120} + | {60, 200} | {60, 201} | {60, 202} | {10, 10} | {10, 11} | {10, 20} + | {10, 21} | {10, 30} | {10, 31} | {10, 40} | {10, 41} | {10, 50} + | {10, 51} | {10, 60} | {10, 61} | {10, 70} | {10, 71} | {20, 10} + | {20, 11} | {20, 20} | {20, 21} | {20, 40} | {20, 41} | {30, 10} + | {30, 11} | {40, 10} | {40, 11} | {40, 20} | {40, 21} | {40, 30} + | {40, 31} | {40, 40} | {40, 51} | {50, 10} | {50, 11} | {50, 20} + | {50, 21} | {50, 30} | {50, 31} | {50, 40} | {50, 41} | {50, 50} + | {50, 51} | {90, 10} | {90, 11} | {90, 20} | {90, 21} | {90, 30} + | {90, 31} | {85, 10} | {85, 11} ). +-type amqp_method_record() :: + ( #'basic.qos'{} | #'basic.qos_ok'{} | #'basic.consume'{} | #'basic.consume_ok'{} + | #'basic.cancel'{} | #'basic.cancel_ok'{} | #'basic.publish'{} | #'basic.return'{} + | #'basic.deliver'{} | #'basic.get'{} | #'basic.get_ok'{} | #'basic.get_empty'{} + | #'basic.ack'{} | #'basic.reject'{} | #'basic.recover_async'{} | #'basic.recover'{} + | #'basic.recover_ok'{} | #'basic.nack'{} | #'basic.credit'{} | #'basic.credit_ok'{} + | #'basic.credit_drained'{} | #'connection.start'{} | #'connection.start_ok'{} | #'connection.secure'{} + | #'connection.secure_ok'{} | #'connection.tune'{} | #'connection.tune_ok'{} | #'connection.open'{} + | #'connection.open_ok'{} | #'connection.close'{} | #'connection.close_ok'{} | #'connection.blocked'{} + | #'connection.unblocked'{} | #'connection.update_secret'{} | #'connection.update_secret_ok'{} | #'channel.open'{} + | #'channel.open_ok'{} | #'channel.flow'{} | #'channel.flow_ok'{} | #'channel.close'{} + | #'channel.close_ok'{} | #'access.request'{} | #'access.request_ok'{} | #'exchange.declare'{} + | #'exchange.declare_ok'{} | #'exchange.delete'{} | #'exchange.delete_ok'{} | #'exchange.bind'{} + | #'exchange.bind_ok'{} | #'exchange.unbind'{} | #'exchange.unbind_ok'{} | #'queue.declare'{} + | #'queue.declare_ok'{} | #'queue.bind'{} | #'queue.bind_ok'{} | #'queue.purge'{} + | #'queue.purge_ok'{} | #'queue.delete'{} | #'queue.delete_ok'{} | #'queue.unbind'{} + | #'queue.unbind_ok'{} | #'tx.select'{} | #'tx.select_ok'{} | #'tx.commit'{} + | #'tx.commit_ok'{} | #'tx.rollback'{} | #'tx.rollback_ok'{} | #'confirm.select'{} + | #'confirm.select_ok'{} ). +-type amqp_method_field_name() :: + ( active | arguments | auto_delete | available + | capabilities | challenge | channel_id | channel_max + | class_id | client_properties | cluster_id | consumer_count + | consumer_tag | credit | credit_drained | delivery_tag + | destination | drain | durable | exchange + | exclusive | frame_max | global | heartbeat + | if_empty | if_unused | immediate | insist + | internal | known_hosts | locale | locales + | mandatory | mechanism | mechanisms | message_count + | method_id | multiple | new_secret | no_ack + | no_local | nowait | out_of_band | passive + | prefetch_count | prefetch_size | queue | read + | realm | reason | redelivered | reply_code + | reply_text | requeue | response | routing_key + | server_properties | source | ticket | type + | version_major | version_minor | virtual_host | write ). +-type amqp_property_record() :: + ( #'P_basic'{} | #'P_connection'{} | #'P_channel'{} | #'P_access'{} + | #'P_exchange'{} | #'P_queue'{} | #'P_tx'{} | #'P_confirm'{} ). +-type amqp_exception() :: + ( 'frame_method' | 'frame_header' | 'frame_body' | 'frame_heartbeat' + | 'frame_min_size' | 'frame_end' | 'reply_success' | 'content_too_large' + | 'no_route' | 'no_consumers' | 'access_refused' | 'not_found' + | 'resource_locked' | 'precondition_failed' | 'connection_forced' | 'invalid_path' + | 'frame_error' | 'syntax_error' | 'command_invalid' | 'channel_error' + | 'unexpected_frame' | 'resource_error' | 'not_allowed' | 'not_implemented' + | 'internal_error' ). +-type amqp_exception_code() :: + ( 1 | 2 | 3 | 8 + | 4096 | 206 | 200 | 311 + | 312 | 313 | 403 | 404 + | 405 | 406 | 320 | 402 + | 501 | 502 | 503 | 504 + | 505 | 506 | 530 | 540 + | 541 ). +-type amqp_class_id() :: + ( 40 | 10 | 50 | 20 + | 85 | 90 | 60 | 30 ). +-type amqp_class_name() :: + ( 'basic' | 'connection' | 'channel' | 'access' + | 'exchange' | 'queue' | 'tx' | 'confirm' ). + +%% Method signatures +-spec version() -> {non_neg_integer(), non_neg_integer(), non_neg_integer()}. +-spec lookup_method_name(amqp_method()) -> amqp_method_name(). +-spec lookup_class_name(amqp_class_id()) -> amqp_class_name(). +-spec method_id(amqp_method_name()) -> amqp_method(). +-spec method_has_content(amqp_method_name()) -> boolean(). +-spec is_method_synchronous(amqp_method_record()) -> boolean(). +-spec method_record(amqp_method_name()) -> amqp_method_record(). +-spec method_fieldnames(amqp_method_name()) -> [amqp_method_field_name()]. +-spec decode_method_fields(amqp_method_name(), binary()) -> + amqp_method_record() | rabbit_types:connection_exit(). +-spec decode_properties(non_neg_integer(), binary()) -> amqp_property_record(). +-spec encode_method_fields(amqp_method_record()) -> binary(). +-spec encode_properties(amqp_property_record()) -> binary(). +-spec lookup_amqp_exception(amqp_exception()) -> + {boolean(), amqp_exception_code(), binary()}. +-spec amqp_exception(amqp_exception_code()) -> amqp_exception(). + +bitvalue(true) -> 1; +bitvalue(false) -> 0; +bitvalue(undefined) -> 0. + +shortstr_size(S) -> + case size(S) of + Len when Len =< 255 -> Len; + _ -> exit(method_field_shortstr_overflow) + end. + +-define(SHORTSTR_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(LONGSTR_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(SHORT_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(LONG_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(LONGLONG_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(OCTET_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(TABLE_VAL(R, L, V, X), + begin + <> = R, + {rabbit_binary_parser:parse_table(V), X} + end). + +-define(TIMESTAMP_VAL(R, L, V, X), + begin + <> = R, + {V, X} + end). + +-define(SHORTSTR_PROP(X, L), + begin + L = size(X), + if L < 256 -> <>; + true -> exit(content_properties_shortstr_overflow) + end + end). + +-define(LONGSTR_PROP(X, L), + begin + L = size(X), + <> + end). + +-define(OCTET_PROP(X, L), <>). +-define(SHORT_PROP(X, L), <>). +-define(LONG_PROP(X, L), <>). +-define(LONGLONG_PROP(X, L), <>). +-define(TIMESTAMP_PROP(X, L), <>). + +-define(TABLE_PROP(X, T), + begin + T = rabbit_binary_generator:generate_table(X), + <<(size(T)):32, T/binary>> + end). + +version() -> {0, 9, 1}. +lookup_method_name({60, 10}) -> 'basic.qos'; +lookup_method_name({60, 11}) -> 'basic.qos_ok'; +lookup_method_name({60, 20}) -> 'basic.consume'; +lookup_method_name({60, 21}) -> 'basic.consume_ok'; +lookup_method_name({60, 30}) -> 'basic.cancel'; +lookup_method_name({60, 31}) -> 'basic.cancel_ok'; +lookup_method_name({60, 40}) -> 'basic.publish'; +lookup_method_name({60, 50}) -> 'basic.return'; +lookup_method_name({60, 60}) -> 'basic.deliver'; +lookup_method_name({60, 70}) -> 'basic.get'; +lookup_method_name({60, 71}) -> 'basic.get_ok'; +lookup_method_name({60, 72}) -> 'basic.get_empty'; +lookup_method_name({60, 80}) -> 'basic.ack'; +lookup_method_name({60, 90}) -> 'basic.reject'; +lookup_method_name({60, 100}) -> 'basic.recover_async'; +lookup_method_name({60, 110}) -> 'basic.recover'; +lookup_method_name({60, 111}) -> 'basic.recover_ok'; +lookup_method_name({60, 120}) -> 'basic.nack'; +lookup_method_name({60, 200}) -> 'basic.credit'; +lookup_method_name({60, 201}) -> 'basic.credit_ok'; +lookup_method_name({60, 202}) -> 'basic.credit_drained'; +lookup_method_name({10, 10}) -> 'connection.start'; +lookup_method_name({10, 11}) -> 'connection.start_ok'; +lookup_method_name({10, 20}) -> 'connection.secure'; +lookup_method_name({10, 21}) -> 'connection.secure_ok'; +lookup_method_name({10, 30}) -> 'connection.tune'; +lookup_method_name({10, 31}) -> 'connection.tune_ok'; +lookup_method_name({10, 40}) -> 'connection.open'; +lookup_method_name({10, 41}) -> 'connection.open_ok'; +lookup_method_name({10, 50}) -> 'connection.close'; +lookup_method_name({10, 51}) -> 'connection.close_ok'; +lookup_method_name({10, 60}) -> 'connection.blocked'; +lookup_method_name({10, 61}) -> 'connection.unblocked'; +lookup_method_name({10, 70}) -> 'connection.update_secret'; +lookup_method_name({10, 71}) -> 'connection.update_secret_ok'; +lookup_method_name({20, 10}) -> 'channel.open'; +lookup_method_name({20, 11}) -> 'channel.open_ok'; +lookup_method_name({20, 20}) -> 'channel.flow'; +lookup_method_name({20, 21}) -> 'channel.flow_ok'; +lookup_method_name({20, 40}) -> 'channel.close'; +lookup_method_name({20, 41}) -> 'channel.close_ok'; +lookup_method_name({30, 10}) -> 'access.request'; +lookup_method_name({30, 11}) -> 'access.request_ok'; +lookup_method_name({40, 10}) -> 'exchange.declare'; +lookup_method_name({40, 11}) -> 'exchange.declare_ok'; +lookup_method_name({40, 20}) -> 'exchange.delete'; +lookup_method_name({40, 21}) -> 'exchange.delete_ok'; +lookup_method_name({40, 30}) -> 'exchange.bind'; +lookup_method_name({40, 31}) -> 'exchange.bind_ok'; +lookup_method_name({40, 40}) -> 'exchange.unbind'; +lookup_method_name({40, 51}) -> 'exchange.unbind_ok'; +lookup_method_name({50, 10}) -> 'queue.declare'; +lookup_method_name({50, 11}) -> 'queue.declare_ok'; +lookup_method_name({50, 20}) -> 'queue.bind'; +lookup_method_name({50, 21}) -> 'queue.bind_ok'; +lookup_method_name({50, 30}) -> 'queue.purge'; +lookup_method_name({50, 31}) -> 'queue.purge_ok'; +lookup_method_name({50, 40}) -> 'queue.delete'; +lookup_method_name({50, 41}) -> 'queue.delete_ok'; +lookup_method_name({50, 50}) -> 'queue.unbind'; +lookup_method_name({50, 51}) -> 'queue.unbind_ok'; +lookup_method_name({90, 10}) -> 'tx.select'; +lookup_method_name({90, 11}) -> 'tx.select_ok'; +lookup_method_name({90, 20}) -> 'tx.commit'; +lookup_method_name({90, 21}) -> 'tx.commit_ok'; +lookup_method_name({90, 30}) -> 'tx.rollback'; +lookup_method_name({90, 31}) -> 'tx.rollback_ok'; +lookup_method_name({85, 10}) -> 'confirm.select'; +lookup_method_name({85, 11}) -> 'confirm.select_ok'; +lookup_method_name({_ClassId, _MethodId} = Id) -> exit({unknown_method_id, Id}). +lookup_class_name(60) -> 'basic'; +lookup_class_name(10) -> 'connection'; +lookup_class_name(20) -> 'channel'; +lookup_class_name(30) -> 'access'; +lookup_class_name(40) -> 'exchange'; +lookup_class_name(50) -> 'queue'; +lookup_class_name(90) -> 'tx'; +lookup_class_name(85) -> 'confirm'; +lookup_class_name(ClassId) -> exit({unknown_class_id, ClassId}). +method_id('basic.qos') -> {60, 10}; +method_id('basic.qos_ok') -> {60, 11}; +method_id('basic.consume') -> {60, 20}; +method_id('basic.consume_ok') -> {60, 21}; +method_id('basic.cancel') -> {60, 30}; +method_id('basic.cancel_ok') -> {60, 31}; +method_id('basic.publish') -> {60, 40}; +method_id('basic.return') -> {60, 50}; +method_id('basic.deliver') -> {60, 60}; +method_id('basic.get') -> {60, 70}; +method_id('basic.get_ok') -> {60, 71}; +method_id('basic.get_empty') -> {60, 72}; +method_id('basic.ack') -> {60, 80}; +method_id('basic.reject') -> {60, 90}; +method_id('basic.recover_async') -> {60, 100}; +method_id('basic.recover') -> {60, 110}; +method_id('basic.recover_ok') -> {60, 111}; +method_id('basic.nack') -> {60, 120}; +method_id('basic.credit') -> {60, 200}; +method_id('basic.credit_ok') -> {60, 201}; +method_id('basic.credit_drained') -> {60, 202}; +method_id('connection.start') -> {10, 10}; +method_id('connection.start_ok') -> {10, 11}; +method_id('connection.secure') -> {10, 20}; +method_id('connection.secure_ok') -> {10, 21}; +method_id('connection.tune') -> {10, 30}; +method_id('connection.tune_ok') -> {10, 31}; +method_id('connection.open') -> {10, 40}; +method_id('connection.open_ok') -> {10, 41}; +method_id('connection.close') -> {10, 50}; +method_id('connection.close_ok') -> {10, 51}; +method_id('connection.blocked') -> {10, 60}; +method_id('connection.unblocked') -> {10, 61}; +method_id('connection.update_secret') -> {10, 70}; +method_id('connection.update_secret_ok') -> {10, 71}; +method_id('channel.open') -> {20, 10}; +method_id('channel.open_ok') -> {20, 11}; +method_id('channel.flow') -> {20, 20}; +method_id('channel.flow_ok') -> {20, 21}; +method_id('channel.close') -> {20, 40}; +method_id('channel.close_ok') -> {20, 41}; +method_id('access.request') -> {30, 10}; +method_id('access.request_ok') -> {30, 11}; +method_id('exchange.declare') -> {40, 10}; +method_id('exchange.declare_ok') -> {40, 11}; +method_id('exchange.delete') -> {40, 20}; +method_id('exchange.delete_ok') -> {40, 21}; +method_id('exchange.bind') -> {40, 30}; +method_id('exchange.bind_ok') -> {40, 31}; +method_id('exchange.unbind') -> {40, 40}; +method_id('exchange.unbind_ok') -> {40, 51}; +method_id('queue.declare') -> {50, 10}; +method_id('queue.declare_ok') -> {50, 11}; +method_id('queue.bind') -> {50, 20}; +method_id('queue.bind_ok') -> {50, 21}; +method_id('queue.purge') -> {50, 30}; +method_id('queue.purge_ok') -> {50, 31}; +method_id('queue.delete') -> {50, 40}; +method_id('queue.delete_ok') -> {50, 41}; +method_id('queue.unbind') -> {50, 50}; +method_id('queue.unbind_ok') -> {50, 51}; +method_id('tx.select') -> {90, 10}; +method_id('tx.select_ok') -> {90, 11}; +method_id('tx.commit') -> {90, 20}; +method_id('tx.commit_ok') -> {90, 21}; +method_id('tx.rollback') -> {90, 30}; +method_id('tx.rollback_ok') -> {90, 31}; +method_id('confirm.select') -> {85, 10}; +method_id('confirm.select_ok') -> {85, 11}; +method_id(Name) -> exit({unknown_method_name, Name}). +method_has_content('basic.qos') -> false; +method_has_content('basic.qos_ok') -> false; +method_has_content('basic.consume') -> false; +method_has_content('basic.consume_ok') -> false; +method_has_content('basic.cancel') -> false; +method_has_content('basic.cancel_ok') -> false; +method_has_content('basic.publish') -> true; +method_has_content('basic.return') -> true; +method_has_content('basic.deliver') -> true; +method_has_content('basic.get') -> false; +method_has_content('basic.get_ok') -> true; +method_has_content('basic.get_empty') -> false; +method_has_content('basic.ack') -> false; +method_has_content('basic.reject') -> false; +method_has_content('basic.recover_async') -> false; +method_has_content('basic.recover') -> false; +method_has_content('basic.recover_ok') -> false; +method_has_content('basic.nack') -> false; +method_has_content('basic.credit') -> false; +method_has_content('basic.credit_ok') -> false; +method_has_content('basic.credit_drained') -> false; +method_has_content('connection.start') -> false; +method_has_content('connection.start_ok') -> false; +method_has_content('connection.secure') -> false; +method_has_content('connection.secure_ok') -> false; +method_has_content('connection.tune') -> false; +method_has_content('connection.tune_ok') -> false; +method_has_content('connection.open') -> false; +method_has_content('connection.open_ok') -> false; +method_has_content('connection.close') -> false; +method_has_content('connection.close_ok') -> false; +method_has_content('connection.blocked') -> false; +method_has_content('connection.unblocked') -> false; +method_has_content('connection.update_secret') -> false; +method_has_content('connection.update_secret_ok') -> false; +method_has_content('channel.open') -> false; +method_has_content('channel.open_ok') -> false; +method_has_content('channel.flow') -> false; +method_has_content('channel.flow_ok') -> false; +method_has_content('channel.close') -> false; +method_has_content('channel.close_ok') -> false; +method_has_content('access.request') -> false; +method_has_content('access.request_ok') -> false; +method_has_content('exchange.declare') -> false; +method_has_content('exchange.declare_ok') -> false; +method_has_content('exchange.delete') -> false; +method_has_content('exchange.delete_ok') -> false; +method_has_content('exchange.bind') -> false; +method_has_content('exchange.bind_ok') -> false; +method_has_content('exchange.unbind') -> false; +method_has_content('exchange.unbind_ok') -> false; +method_has_content('queue.declare') -> false; +method_has_content('queue.declare_ok') -> false; +method_has_content('queue.bind') -> false; +method_has_content('queue.bind_ok') -> false; +method_has_content('queue.purge') -> false; +method_has_content('queue.purge_ok') -> false; +method_has_content('queue.delete') -> false; +method_has_content('queue.delete_ok') -> false; +method_has_content('queue.unbind') -> false; +method_has_content('queue.unbind_ok') -> false; +method_has_content('tx.select') -> false; +method_has_content('tx.select_ok') -> false; +method_has_content('tx.commit') -> false; +method_has_content('tx.commit_ok') -> false; +method_has_content('tx.rollback') -> false; +method_has_content('tx.rollback_ok') -> false; +method_has_content('confirm.select') -> false; +method_has_content('confirm.select_ok') -> false; +method_has_content(Name) -> exit({unknown_method_name, Name}). +is_method_synchronous(#'basic.qos'{}) -> true; +is_method_synchronous(#'basic.qos_ok'{}) -> false; +is_method_synchronous(#'basic.consume'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'basic.consume_ok'{}) -> false; +is_method_synchronous(#'basic.cancel'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'basic.cancel_ok'{}) -> false; +is_method_synchronous(#'basic.publish'{}) -> false; +is_method_synchronous(#'basic.return'{}) -> false; +is_method_synchronous(#'basic.deliver'{}) -> false; +is_method_synchronous(#'basic.get'{}) -> true; +is_method_synchronous(#'basic.get_ok'{}) -> false; +is_method_synchronous(#'basic.get_empty'{}) -> false; +is_method_synchronous(#'basic.ack'{}) -> false; +is_method_synchronous(#'basic.reject'{}) -> false; +is_method_synchronous(#'basic.recover_async'{}) -> false; +is_method_synchronous(#'basic.recover'{}) -> true; +is_method_synchronous(#'basic.recover_ok'{}) -> false; +is_method_synchronous(#'basic.nack'{}) -> false; +is_method_synchronous(#'basic.credit'{}) -> true; +is_method_synchronous(#'basic.credit_ok'{}) -> false; +is_method_synchronous(#'basic.credit_drained'{}) -> false; +is_method_synchronous(#'connection.start'{}) -> true; +is_method_synchronous(#'connection.start_ok'{}) -> false; +is_method_synchronous(#'connection.secure'{}) -> true; +is_method_synchronous(#'connection.secure_ok'{}) -> false; +is_method_synchronous(#'connection.tune'{}) -> true; +is_method_synchronous(#'connection.tune_ok'{}) -> false; +is_method_synchronous(#'connection.open'{}) -> true; +is_method_synchronous(#'connection.open_ok'{}) -> false; +is_method_synchronous(#'connection.close'{}) -> true; +is_method_synchronous(#'connection.close_ok'{}) -> false; +is_method_synchronous(#'connection.blocked'{}) -> false; +is_method_synchronous(#'connection.unblocked'{}) -> false; +is_method_synchronous(#'connection.update_secret'{}) -> true; +is_method_synchronous(#'connection.update_secret_ok'{}) -> false; +is_method_synchronous(#'channel.open'{}) -> true; +is_method_synchronous(#'channel.open_ok'{}) -> false; +is_method_synchronous(#'channel.flow'{}) -> true; +is_method_synchronous(#'channel.flow_ok'{}) -> false; +is_method_synchronous(#'channel.close'{}) -> true; +is_method_synchronous(#'channel.close_ok'{}) -> false; +is_method_synchronous(#'access.request'{}) -> true; +is_method_synchronous(#'access.request_ok'{}) -> false; +is_method_synchronous(#'exchange.declare'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'exchange.declare_ok'{}) -> false; +is_method_synchronous(#'exchange.delete'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'exchange.delete_ok'{}) -> false; +is_method_synchronous(#'exchange.bind'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'exchange.bind_ok'{}) -> false; +is_method_synchronous(#'exchange.unbind'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'exchange.unbind_ok'{}) -> false; +is_method_synchronous(#'queue.declare'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'queue.declare_ok'{}) -> false; +is_method_synchronous(#'queue.bind'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'queue.bind_ok'{}) -> false; +is_method_synchronous(#'queue.purge'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'queue.purge_ok'{}) -> false; +is_method_synchronous(#'queue.delete'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'queue.delete_ok'{}) -> false; +is_method_synchronous(#'queue.unbind'{}) -> true; +is_method_synchronous(#'queue.unbind_ok'{}) -> false; +is_method_synchronous(#'tx.select'{}) -> true; +is_method_synchronous(#'tx.select_ok'{}) -> false; +is_method_synchronous(#'tx.commit'{}) -> true; +is_method_synchronous(#'tx.commit_ok'{}) -> false; +is_method_synchronous(#'tx.rollback'{}) -> true; +is_method_synchronous(#'tx.rollback_ok'{}) -> false; +is_method_synchronous(#'confirm.select'{nowait = NoWait}) -> not(NoWait); +is_method_synchronous(#'confirm.select_ok'{}) -> false; +is_method_synchronous(Name) -> exit({unknown_method_name, Name}). +method_record('basic.qos') -> #'basic.qos'{}; +method_record('basic.qos_ok') -> #'basic.qos_ok'{}; +method_record('basic.consume') -> #'basic.consume'{}; +method_record('basic.consume_ok') -> #'basic.consume_ok'{}; +method_record('basic.cancel') -> #'basic.cancel'{}; +method_record('basic.cancel_ok') -> #'basic.cancel_ok'{}; +method_record('basic.publish') -> #'basic.publish'{}; +method_record('basic.return') -> #'basic.return'{}; +method_record('basic.deliver') -> #'basic.deliver'{}; +method_record('basic.get') -> #'basic.get'{}; +method_record('basic.get_ok') -> #'basic.get_ok'{}; +method_record('basic.get_empty') -> #'basic.get_empty'{}; +method_record('basic.ack') -> #'basic.ack'{}; +method_record('basic.reject') -> #'basic.reject'{}; +method_record('basic.recover_async') -> #'basic.recover_async'{}; +method_record('basic.recover') -> #'basic.recover'{}; +method_record('basic.recover_ok') -> #'basic.recover_ok'{}; +method_record('basic.nack') -> #'basic.nack'{}; +method_record('basic.credit') -> #'basic.credit'{}; +method_record('basic.credit_ok') -> #'basic.credit_ok'{}; +method_record('basic.credit_drained') -> #'basic.credit_drained'{}; +method_record('connection.start') -> #'connection.start'{}; +method_record('connection.start_ok') -> #'connection.start_ok'{}; +method_record('connection.secure') -> #'connection.secure'{}; +method_record('connection.secure_ok') -> #'connection.secure_ok'{}; +method_record('connection.tune') -> #'connection.tune'{}; +method_record('connection.tune_ok') -> #'connection.tune_ok'{}; +method_record('connection.open') -> #'connection.open'{}; +method_record('connection.open_ok') -> #'connection.open_ok'{}; +method_record('connection.close') -> #'connection.close'{}; +method_record('connection.close_ok') -> #'connection.close_ok'{}; +method_record('connection.blocked') -> #'connection.blocked'{}; +method_record('connection.unblocked') -> #'connection.unblocked'{}; +method_record('connection.update_secret') -> #'connection.update_secret'{}; +method_record('connection.update_secret_ok') -> #'connection.update_secret_ok'{}; +method_record('channel.open') -> #'channel.open'{}; +method_record('channel.open_ok') -> #'channel.open_ok'{}; +method_record('channel.flow') -> #'channel.flow'{}; +method_record('channel.flow_ok') -> #'channel.flow_ok'{}; +method_record('channel.close') -> #'channel.close'{}; +method_record('channel.close_ok') -> #'channel.close_ok'{}; +method_record('access.request') -> #'access.request'{}; +method_record('access.request_ok') -> #'access.request_ok'{}; +method_record('exchange.declare') -> #'exchange.declare'{}; +method_record('exchange.declare_ok') -> #'exchange.declare_ok'{}; +method_record('exchange.delete') -> #'exchange.delete'{}; +method_record('exchange.delete_ok') -> #'exchange.delete_ok'{}; +method_record('exchange.bind') -> #'exchange.bind'{}; +method_record('exchange.bind_ok') -> #'exchange.bind_ok'{}; +method_record('exchange.unbind') -> #'exchange.unbind'{}; +method_record('exchange.unbind_ok') -> #'exchange.unbind_ok'{}; +method_record('queue.declare') -> #'queue.declare'{}; +method_record('queue.declare_ok') -> #'queue.declare_ok'{}; +method_record('queue.bind') -> #'queue.bind'{}; +method_record('queue.bind_ok') -> #'queue.bind_ok'{}; +method_record('queue.purge') -> #'queue.purge'{}; +method_record('queue.purge_ok') -> #'queue.purge_ok'{}; +method_record('queue.delete') -> #'queue.delete'{}; +method_record('queue.delete_ok') -> #'queue.delete_ok'{}; +method_record('queue.unbind') -> #'queue.unbind'{}; +method_record('queue.unbind_ok') -> #'queue.unbind_ok'{}; +method_record('tx.select') -> #'tx.select'{}; +method_record('tx.select_ok') -> #'tx.select_ok'{}; +method_record('tx.commit') -> #'tx.commit'{}; +method_record('tx.commit_ok') -> #'tx.commit_ok'{}; +method_record('tx.rollback') -> #'tx.rollback'{}; +method_record('tx.rollback_ok') -> #'tx.rollback_ok'{}; +method_record('confirm.select') -> #'confirm.select'{}; +method_record('confirm.select_ok') -> #'confirm.select_ok'{}; +method_record(Name) -> exit({unknown_method_name, Name}). +method_fieldnames('basic.qos') -> [prefetch_size, prefetch_count, global]; +method_fieldnames('basic.qos_ok') -> []; +method_fieldnames('basic.consume') -> [ticket, queue, consumer_tag, no_local, no_ack, exclusive, nowait, arguments]; +method_fieldnames('basic.consume_ok') -> [consumer_tag]; +method_fieldnames('basic.cancel') -> [consumer_tag, nowait]; +method_fieldnames('basic.cancel_ok') -> [consumer_tag]; +method_fieldnames('basic.publish') -> [ticket, exchange, routing_key, mandatory, immediate]; +method_fieldnames('basic.return') -> [reply_code, reply_text, exchange, routing_key]; +method_fieldnames('basic.deliver') -> [consumer_tag, delivery_tag, redelivered, exchange, routing_key]; +method_fieldnames('basic.get') -> [ticket, queue, no_ack]; +method_fieldnames('basic.get_ok') -> [delivery_tag, redelivered, exchange, routing_key, message_count]; +method_fieldnames('basic.get_empty') -> [cluster_id]; +method_fieldnames('basic.ack') -> [delivery_tag, multiple]; +method_fieldnames('basic.reject') -> [delivery_tag, requeue]; +method_fieldnames('basic.recover_async') -> [requeue]; +method_fieldnames('basic.recover') -> [requeue]; +method_fieldnames('basic.recover_ok') -> []; +method_fieldnames('basic.nack') -> [delivery_tag, multiple, requeue]; +method_fieldnames('basic.credit') -> [consumer_tag, credit, drain]; +method_fieldnames('basic.credit_ok') -> [available]; +method_fieldnames('basic.credit_drained') -> [consumer_tag, credit_drained]; +method_fieldnames('connection.start') -> [version_major, version_minor, server_properties, mechanisms, locales]; +method_fieldnames('connection.start_ok') -> [client_properties, mechanism, response, locale]; +method_fieldnames('connection.secure') -> [challenge]; +method_fieldnames('connection.secure_ok') -> [response]; +method_fieldnames('connection.tune') -> [channel_max, frame_max, heartbeat]; +method_fieldnames('connection.tune_ok') -> [channel_max, frame_max, heartbeat]; +method_fieldnames('connection.open') -> [virtual_host, capabilities, insist]; +method_fieldnames('connection.open_ok') -> [known_hosts]; +method_fieldnames('connection.close') -> [reply_code, reply_text, class_id, method_id]; +method_fieldnames('connection.close_ok') -> []; +method_fieldnames('connection.blocked') -> [reason]; +method_fieldnames('connection.unblocked') -> []; +method_fieldnames('connection.update_secret') -> [new_secret, reason]; +method_fieldnames('connection.update_secret_ok') -> []; +method_fieldnames('channel.open') -> [out_of_band]; +method_fieldnames('channel.open_ok') -> [channel_id]; +method_fieldnames('channel.flow') -> [active]; +method_fieldnames('channel.flow_ok') -> [active]; +method_fieldnames('channel.close') -> [reply_code, reply_text, class_id, method_id]; +method_fieldnames('channel.close_ok') -> []; +method_fieldnames('access.request') -> [realm, exclusive, passive, active, write, read]; +method_fieldnames('access.request_ok') -> [ticket]; +method_fieldnames('exchange.declare') -> [ticket, exchange, type, passive, durable, auto_delete, internal, nowait, arguments]; +method_fieldnames('exchange.declare_ok') -> []; +method_fieldnames('exchange.delete') -> [ticket, exchange, if_unused, nowait]; +method_fieldnames('exchange.delete_ok') -> []; +method_fieldnames('exchange.bind') -> [ticket, destination, source, routing_key, nowait, arguments]; +method_fieldnames('exchange.bind_ok') -> []; +method_fieldnames('exchange.unbind') -> [ticket, destination, source, routing_key, nowait, arguments]; +method_fieldnames('exchange.unbind_ok') -> []; +method_fieldnames('queue.declare') -> [ticket, queue, passive, durable, exclusive, auto_delete, nowait, arguments]; +method_fieldnames('queue.declare_ok') -> [queue, message_count, consumer_count]; +method_fieldnames('queue.bind') -> [ticket, queue, exchange, routing_key, nowait, arguments]; +method_fieldnames('queue.bind_ok') -> []; +method_fieldnames('queue.purge') -> [ticket, queue, nowait]; +method_fieldnames('queue.purge_ok') -> [message_count]; +method_fieldnames('queue.delete') -> [ticket, queue, if_unused, if_empty, nowait]; +method_fieldnames('queue.delete_ok') -> [message_count]; +method_fieldnames('queue.unbind') -> [ticket, queue, exchange, routing_key, arguments]; +method_fieldnames('queue.unbind_ok') -> []; +method_fieldnames('tx.select') -> []; +method_fieldnames('tx.select_ok') -> []; +method_fieldnames('tx.commit') -> []; +method_fieldnames('tx.commit_ok') -> []; +method_fieldnames('tx.rollback') -> []; +method_fieldnames('tx.rollback_ok') -> []; +method_fieldnames('confirm.select') -> [nowait]; +method_fieldnames('confirm.select_ok') -> []; +method_fieldnames(Name) -> exit({unknown_method_name, Name}). +decode_method_fields('basic.qos', <>) -> + F2 = ((F2Bits band 1) /= 0), + #'basic.qos'{prefetch_size = F0, prefetch_count = F1, global = F2}; +decode_method_fields('basic.qos_ok', <<>>) -> + #'basic.qos_ok'{}; +decode_method_fields('basic.consume', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + F3 = ((F3Bits band 1) /= 0), + F4 = ((F3Bits band 2) /= 0), + F5 = ((F3Bits band 4) /= 0), + F6 = ((F3Bits band 8) /= 0), + F7 = rabbit_binary_parser:parse_table(F7Tab), + #'basic.consume'{ticket = F0, queue = F1, consumer_tag = F2, no_local = F3, no_ack = F4, exclusive = F5, nowait = F6, arguments = F7}; +decode_method_fields('basic.consume_ok', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'basic.consume_ok'{consumer_tag = F0}; +decode_method_fields('basic.cancel', <>) -> + rabbit_binary_parser:assert_utf8(F0), + F1 = ((F1Bits band 1) /= 0), + #'basic.cancel'{consumer_tag = F0, nowait = F1}; +decode_method_fields('basic.cancel_ok', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'basic.cancel_ok'{consumer_tag = F0}; +decode_method_fields('basic.publish', <>) -> + F3 = ((F3Bits band 1) /= 0), + F4 = ((F3Bits band 2) /= 0), + #'basic.publish'{ticket = F0, exchange = F1, routing_key = F2, mandatory = F3, immediate = F4}; +decode_method_fields('basic.return', <>) -> + #'basic.return'{reply_code = F0, reply_text = F1, exchange = F2, routing_key = F3}; +decode_method_fields('basic.deliver', <>) -> + F2 = ((F2Bits band 1) /= 0), + #'basic.deliver'{consumer_tag = F0, delivery_tag = F1, redelivered = F2, exchange = F3, routing_key = F4}; +decode_method_fields('basic.get', <>) -> + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + #'basic.get'{ticket = F0, queue = F1, no_ack = F2}; +decode_method_fields('basic.get_ok', <>) -> + F1 = ((F1Bits band 1) /= 0), + #'basic.get_ok'{delivery_tag = F0, redelivered = F1, exchange = F2, routing_key = F3, message_count = F4}; +decode_method_fields('basic.get_empty', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'basic.get_empty'{cluster_id = F0}; +decode_method_fields('basic.ack', <>) -> + F1 = ((F1Bits band 1) /= 0), + #'basic.ack'{delivery_tag = F0, multiple = F1}; +decode_method_fields('basic.reject', <>) -> + F1 = ((F1Bits band 1) /= 0), + #'basic.reject'{delivery_tag = F0, requeue = F1}; +decode_method_fields('basic.recover_async', <>) -> + F0 = ((F0Bits band 1) /= 0), + #'basic.recover_async'{requeue = F0}; +decode_method_fields('basic.recover', <>) -> + F0 = ((F0Bits band 1) /= 0), + #'basic.recover'{requeue = F0}; +decode_method_fields('basic.recover_ok', <<>>) -> + #'basic.recover_ok'{}; +decode_method_fields('basic.nack', <>) -> + F1 = ((F1Bits band 1) /= 0), + F2 = ((F1Bits band 2) /= 0), + #'basic.nack'{delivery_tag = F0, multiple = F1, requeue = F2}; +decode_method_fields('basic.credit', <>) -> + rabbit_binary_parser:assert_utf8(F0), + F2 = ((F2Bits band 1) /= 0), + #'basic.credit'{consumer_tag = F0, credit = F1, drain = F2}; +decode_method_fields('basic.credit_ok', <>) -> + #'basic.credit_ok'{available = F0}; +decode_method_fields('basic.credit_drained', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'basic.credit_drained'{consumer_tag = F0, credit_drained = F1}; +decode_method_fields('connection.start', <>) -> + F2 = rabbit_binary_parser:parse_table(F2Tab), + #'connection.start'{version_major = F0, version_minor = F1, server_properties = F2, mechanisms = F3, locales = F4}; +decode_method_fields('connection.start_ok', <>) -> + F0 = rabbit_binary_parser:parse_table(F0Tab), + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F3), + #'connection.start_ok'{client_properties = F0, mechanism = F1, response = F2, locale = F3}; +decode_method_fields('connection.secure', <>) -> + #'connection.secure'{challenge = F0}; +decode_method_fields('connection.secure_ok', <>) -> + #'connection.secure_ok'{response = F0}; +decode_method_fields('connection.tune', <>) -> + #'connection.tune'{channel_max = F0, frame_max = F1, heartbeat = F2}; +decode_method_fields('connection.tune_ok', <>) -> + #'connection.tune_ok'{channel_max = F0, frame_max = F1, heartbeat = F2}; +decode_method_fields('connection.open', <>) -> + rabbit_binary_parser:assert_utf8(F0), + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + #'connection.open'{virtual_host = F0, capabilities = F1, insist = F2}; +decode_method_fields('connection.open_ok', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'connection.open_ok'{known_hosts = F0}; +decode_method_fields('connection.close', <>) -> + rabbit_binary_parser:assert_utf8(F1), + #'connection.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}; +decode_method_fields('connection.close_ok', <<>>) -> + #'connection.close_ok'{}; +decode_method_fields('connection.blocked', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'connection.blocked'{reason = F0}; +decode_method_fields('connection.unblocked', <<>>) -> + #'connection.unblocked'{}; +decode_method_fields('connection.update_secret', <>) -> + rabbit_binary_parser:assert_utf8(F1), + #'connection.update_secret'{new_secret = F0, reason = F1}; +decode_method_fields('connection.update_secret_ok', <<>>) -> + #'connection.update_secret_ok'{}; +decode_method_fields('channel.open', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'channel.open'{out_of_band = F0}; +decode_method_fields('channel.open_ok', <>) -> + #'channel.open_ok'{channel_id = F0}; +decode_method_fields('channel.flow', <>) -> + F0 = ((F0Bits band 1) /= 0), + #'channel.flow'{active = F0}; +decode_method_fields('channel.flow_ok', <>) -> + F0 = ((F0Bits band 1) /= 0), + #'channel.flow_ok'{active = F0}; +decode_method_fields('channel.close', <>) -> + rabbit_binary_parser:assert_utf8(F1), + #'channel.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}; +decode_method_fields('channel.close_ok', <<>>) -> + #'channel.close_ok'{}; +decode_method_fields('access.request', <>) -> + rabbit_binary_parser:assert_utf8(F0), + F1 = ((F1Bits band 1) /= 0), + F2 = ((F1Bits band 2) /= 0), + F3 = ((F1Bits band 4) /= 0), + F4 = ((F1Bits band 8) /= 0), + F5 = ((F1Bits band 16) /= 0), + #'access.request'{realm = F0, exclusive = F1, passive = F2, active = F3, write = F4, read = F5}; +decode_method_fields('access.request_ok', <>) -> + #'access.request_ok'{ticket = F0}; +decode_method_fields('exchange.declare', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + F3 = ((F3Bits band 1) /= 0), + F4 = ((F3Bits band 2) /= 0), + F5 = ((F3Bits band 4) /= 0), + F6 = ((F3Bits band 8) /= 0), + F7 = ((F3Bits band 16) /= 0), + F8 = rabbit_binary_parser:parse_table(F8Tab), + #'exchange.declare'{ticket = F0, exchange = F1, type = F2, passive = F3, durable = F4, auto_delete = F5, internal = F6, nowait = F7, arguments = F8}; +decode_method_fields('exchange.declare_ok', <<>>) -> + #'exchange.declare_ok'{}; +decode_method_fields('exchange.delete', <>) -> + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + F3 = ((F2Bits band 2) /= 0), + #'exchange.delete'{ticket = F0, exchange = F1, if_unused = F2, nowait = F3}; +decode_method_fields('exchange.delete_ok', <<>>) -> + #'exchange.delete_ok'{}; +decode_method_fields('exchange.bind', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + rabbit_binary_parser:assert_utf8(F3), + F4 = ((F4Bits band 1) /= 0), + F5 = rabbit_binary_parser:parse_table(F5Tab), + #'exchange.bind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}; +decode_method_fields('exchange.bind_ok', <<>>) -> + #'exchange.bind_ok'{}; +decode_method_fields('exchange.unbind', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + rabbit_binary_parser:assert_utf8(F3), + F4 = ((F4Bits band 1) /= 0), + F5 = rabbit_binary_parser:parse_table(F5Tab), + #'exchange.unbind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}; +decode_method_fields('exchange.unbind_ok', <<>>) -> + #'exchange.unbind_ok'{}; +decode_method_fields('queue.declare', <>) -> + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + F3 = ((F2Bits band 2) /= 0), + F4 = ((F2Bits band 4) /= 0), + F5 = ((F2Bits band 8) /= 0), + F6 = ((F2Bits band 16) /= 0), + F7 = rabbit_binary_parser:parse_table(F7Tab), + #'queue.declare'{ticket = F0, queue = F1, passive = F2, durable = F3, exclusive = F4, auto_delete = F5, nowait = F6, arguments = F7}; +decode_method_fields('queue.declare_ok', <>) -> + rabbit_binary_parser:assert_utf8(F0), + #'queue.declare_ok'{queue = F0, message_count = F1, consumer_count = F2}; +decode_method_fields('queue.bind', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + rabbit_binary_parser:assert_utf8(F3), + F4 = ((F4Bits band 1) /= 0), + F5 = rabbit_binary_parser:parse_table(F5Tab), + #'queue.bind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, nowait = F4, arguments = F5}; +decode_method_fields('queue.bind_ok', <<>>) -> + #'queue.bind_ok'{}; +decode_method_fields('queue.purge', <>) -> + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + #'queue.purge'{ticket = F0, queue = F1, nowait = F2}; +decode_method_fields('queue.purge_ok', <>) -> + #'queue.purge_ok'{message_count = F0}; +decode_method_fields('queue.delete', <>) -> + rabbit_binary_parser:assert_utf8(F1), + F2 = ((F2Bits band 1) /= 0), + F3 = ((F2Bits band 2) /= 0), + F4 = ((F2Bits band 4) /= 0), + #'queue.delete'{ticket = F0, queue = F1, if_unused = F2, if_empty = F3, nowait = F4}; +decode_method_fields('queue.delete_ok', <>) -> + #'queue.delete_ok'{message_count = F0}; +decode_method_fields('queue.unbind', <>) -> + rabbit_binary_parser:assert_utf8(F1), + rabbit_binary_parser:assert_utf8(F2), + rabbit_binary_parser:assert_utf8(F3), + F4 = rabbit_binary_parser:parse_table(F4Tab), + #'queue.unbind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, arguments = F4}; +decode_method_fields('queue.unbind_ok', <<>>) -> + #'queue.unbind_ok'{}; +decode_method_fields('tx.select', <<>>) -> + #'tx.select'{}; +decode_method_fields('tx.select_ok', <<>>) -> + #'tx.select_ok'{}; +decode_method_fields('tx.commit', <<>>) -> + #'tx.commit'{}; +decode_method_fields('tx.commit_ok', <<>>) -> + #'tx.commit_ok'{}; +decode_method_fields('tx.rollback', <<>>) -> + #'tx.rollback'{}; +decode_method_fields('tx.rollback_ok', <<>>) -> + #'tx.rollback_ok'{}; +decode_method_fields('confirm.select', <>) -> + F0 = ((F0Bits band 1) /= 0), + #'confirm.select'{nowait = F0}; +decode_method_fields('confirm.select_ok', <<>>) -> + #'confirm.select_ok'{}; +decode_method_fields(Name, BinaryFields) -> + rabbit_misc:frame_error(Name, BinaryFields). +decode_properties(60, <>) -> + {F0, R1} = if P0 =:= 0 -> {undefined, R0}; true -> ?SHORTSTR_VAL(R0, L0, V0, X0) end, + {F1, R2} = if P1 =:= 0 -> {undefined, R1}; true -> ?SHORTSTR_VAL(R1, L1, V1, X1) end, + {F2, R3} = if P2 =:= 0 -> {undefined, R2}; true -> ?TABLE_VAL(R2, L2, V2, X2) end, + {F3, R4} = if P3 =:= 0 -> {undefined, R3}; true -> ?OCTET_VAL(R3, L3, V3, X3) end, + {F4, R5} = if P4 =:= 0 -> {undefined, R4}; true -> ?OCTET_VAL(R4, L4, V4, X4) end, + {F5, R6} = if P5 =:= 0 -> {undefined, R5}; true -> ?SHORTSTR_VAL(R5, L5, V5, X5) end, + {F6, R7} = if P6 =:= 0 -> {undefined, R6}; true -> ?SHORTSTR_VAL(R6, L6, V6, X6) end, + {F7, R8} = if P7 =:= 0 -> {undefined, R7}; true -> ?SHORTSTR_VAL(R7, L7, V7, X7) end, + {F8, R9} = if P8 =:= 0 -> {undefined, R8}; true -> ?SHORTSTR_VAL(R8, L8, V8, X8) end, + {F9, R10} = if P9 =:= 0 -> {undefined, R9}; true -> ?TIMESTAMP_VAL(R9, L9, V9, X9) end, + {F10, R11} = if P10 =:= 0 -> {undefined, R10}; true -> ?SHORTSTR_VAL(R10, L10, V10, X10) end, + {F11, R12} = if P11 =:= 0 -> {undefined, R11}; true -> ?SHORTSTR_VAL(R11, L11, V11, X11) end, + {F12, R13} = if P12 =:= 0 -> {undefined, R12}; true -> ?SHORTSTR_VAL(R12, L12, V12, X12) end, + {F13, R14} = if P13 =:= 0 -> {undefined, R13}; true -> ?SHORTSTR_VAL(R13, L13, V13, X13) end, + <<>> = R14, + #'P_basic'{content_type = F0, content_encoding = F1, headers = F2, delivery_mode = F3, priority = F4, correlation_id = F5, reply_to = F6, expiration = F7, message_id = F8, timestamp = F9, type = F10, user_id = F11, app_id = F12, cluster_id = F13}; +decode_properties(10, <<>>) -> + #'P_connection'{}; +decode_properties(20, <<>>) -> + #'P_channel'{}; +decode_properties(30, <<>>) -> + #'P_access'{}; +decode_properties(40, <<>>) -> + #'P_exchange'{}; +decode_properties(50, <<>>) -> + #'P_queue'{}; +decode_properties(90, <<>>) -> + #'P_tx'{}; +decode_properties(85, <<>>) -> + #'P_confirm'{}; +decode_properties(ClassId, _BinaryFields) -> exit({unknown_class_id, ClassId}). +encode_method_fields(#'basic.qos'{prefetch_size = F0, prefetch_count = F1, global = F2}) -> + F2Bits = ((bitvalue(F2) bsl 0)), + <>; +encode_method_fields(#'basic.qos_ok'{}) -> + <<>>; +encode_method_fields(#'basic.consume'{ticket = F0, queue = F1, consumer_tag = F2, no_local = F3, no_ack = F4, exclusive = F5, nowait = F6, arguments = F7}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Bits = ((bitvalue(F3) bsl 0) bor (bitvalue(F4) bsl 1) bor (bitvalue(F5) bsl 2) bor (bitvalue(F6) bsl 3)), + F7Tab = rabbit_binary_generator:generate_table(F7), + F7Len = size(F7Tab), + <>; +encode_method_fields(#'basic.consume_ok'{consumer_tag = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'basic.cancel'{consumer_tag = F0, nowait = F1}) -> + F0Len = shortstr_size(F0), + F1Bits = ((bitvalue(F1) bsl 0)), + <>; +encode_method_fields(#'basic.cancel_ok'{consumer_tag = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'basic.publish'{ticket = F0, exchange = F1, routing_key = F2, mandatory = F3, immediate = F4}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Bits = ((bitvalue(F3) bsl 0) bor (bitvalue(F4) bsl 1)), + <>; +encode_method_fields(#'basic.return'{reply_code = F0, reply_text = F1, exchange = F2, routing_key = F3}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + <>; +encode_method_fields(#'basic.deliver'{consumer_tag = F0, delivery_tag = F1, redelivered = F2, exchange = F3, routing_key = F4}) -> + F0Len = shortstr_size(F0), + F2Bits = ((bitvalue(F2) bsl 0)), + F3Len = shortstr_size(F3), + F4Len = shortstr_size(F4), + <>; +encode_method_fields(#'basic.get'{ticket = F0, queue = F1, no_ack = F2}) -> + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0)), + <>; +encode_method_fields(#'basic.get_ok'{delivery_tag = F0, redelivered = F1, exchange = F2, routing_key = F3, message_count = F4}) -> + F1Bits = ((bitvalue(F1) bsl 0)), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + <>; +encode_method_fields(#'basic.get_empty'{cluster_id = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'basic.ack'{delivery_tag = F0, multiple = F1}) -> + F1Bits = ((bitvalue(F1) bsl 0)), + <>; +encode_method_fields(#'basic.reject'{delivery_tag = F0, requeue = F1}) -> + F1Bits = ((bitvalue(F1) bsl 0)), + <>; +encode_method_fields(#'basic.recover_async'{requeue = F0}) -> + F0Bits = ((bitvalue(F0) bsl 0)), + <>; +encode_method_fields(#'basic.recover'{requeue = F0}) -> + F0Bits = ((bitvalue(F0) bsl 0)), + <>; +encode_method_fields(#'basic.recover_ok'{}) -> + <<>>; +encode_method_fields(#'basic.nack'{delivery_tag = F0, multiple = F1, requeue = F2}) -> + F1Bits = ((bitvalue(F1) bsl 0) bor (bitvalue(F2) bsl 1)), + <>; +encode_method_fields(#'basic.credit'{consumer_tag = F0, credit = F1, drain = F2}) -> + F0Len = shortstr_size(F0), + F2Bits = ((bitvalue(F2) bsl 0)), + <>; +encode_method_fields(#'basic.credit_ok'{available = F0}) -> + <>; +encode_method_fields(#'basic.credit_drained'{consumer_tag = F0, credit_drained = F1}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'connection.start'{version_major = F0, version_minor = F1, server_properties = F2, mechanisms = F3, locales = F4}) -> + F2Tab = rabbit_binary_generator:generate_table(F2), + F2Len = size(F2Tab), + F3Len = size(F3), + F4Len = size(F4), + <>; +encode_method_fields(#'connection.start_ok'{client_properties = F0, mechanism = F1, response = F2, locale = F3}) -> + F0Tab = rabbit_binary_generator:generate_table(F0), + F0Len = size(F0Tab), + F1Len = shortstr_size(F1), + F2Len = size(F2), + F3Len = shortstr_size(F3), + <>; +encode_method_fields(#'connection.secure'{challenge = F0}) -> + F0Len = size(F0), + <>; +encode_method_fields(#'connection.secure_ok'{response = F0}) -> + F0Len = size(F0), + <>; +encode_method_fields(#'connection.tune'{channel_max = F0, frame_max = F1, heartbeat = F2}) -> + <>; +encode_method_fields(#'connection.tune_ok'{channel_max = F0, frame_max = F1, heartbeat = F2}) -> + <>; +encode_method_fields(#'connection.open'{virtual_host = F0, capabilities = F1, insist = F2}) -> + F0Len = shortstr_size(F0), + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0)), + <>; +encode_method_fields(#'connection.open_ok'{known_hosts = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'connection.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}) -> + F1Len = shortstr_size(F1), + <>; +encode_method_fields(#'connection.close_ok'{}) -> + <<>>; +encode_method_fields(#'connection.blocked'{reason = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'connection.unblocked'{}) -> + <<>>; +encode_method_fields(#'connection.update_secret'{new_secret = F0, reason = F1}) -> + F0Len = size(F0), + F1Len = shortstr_size(F1), + <>; +encode_method_fields(#'connection.update_secret_ok'{}) -> + <<>>; +encode_method_fields(#'channel.open'{out_of_band = F0}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'channel.open_ok'{channel_id = F0}) -> + F0Len = size(F0), + <>; +encode_method_fields(#'channel.flow'{active = F0}) -> + F0Bits = ((bitvalue(F0) bsl 0)), + <>; +encode_method_fields(#'channel.flow_ok'{active = F0}) -> + F0Bits = ((bitvalue(F0) bsl 0)), + <>; +encode_method_fields(#'channel.close'{reply_code = F0, reply_text = F1, class_id = F2, method_id = F3}) -> + F1Len = shortstr_size(F1), + <>; +encode_method_fields(#'channel.close_ok'{}) -> + <<>>; +encode_method_fields(#'access.request'{realm = F0, exclusive = F1, passive = F2, active = F3, write = F4, read = F5}) -> + F0Len = shortstr_size(F0), + F1Bits = ((bitvalue(F1) bsl 0) bor (bitvalue(F2) bsl 1) bor (bitvalue(F3) bsl 2) bor (bitvalue(F4) bsl 3) bor (bitvalue(F5) bsl 4)), + <>; +encode_method_fields(#'access.request_ok'{ticket = F0}) -> + <>; +encode_method_fields(#'exchange.declare'{ticket = F0, exchange = F1, type = F2, passive = F3, durable = F4, auto_delete = F5, internal = F6, nowait = F7, arguments = F8}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Bits = ((bitvalue(F3) bsl 0) bor (bitvalue(F4) bsl 1) bor (bitvalue(F5) bsl 2) bor (bitvalue(F6) bsl 3) bor (bitvalue(F7) bsl 4)), + F8Tab = rabbit_binary_generator:generate_table(F8), + F8Len = size(F8Tab), + <>; +encode_method_fields(#'exchange.declare_ok'{}) -> + <<>>; +encode_method_fields(#'exchange.delete'{ticket = F0, exchange = F1, if_unused = F2, nowait = F3}) -> + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0) bor (bitvalue(F3) bsl 1)), + <>; +encode_method_fields(#'exchange.delete_ok'{}) -> + <<>>; +encode_method_fields(#'exchange.bind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + F4Bits = ((bitvalue(F4) bsl 0)), + F5Tab = rabbit_binary_generator:generate_table(F5), + F5Len = size(F5Tab), + <>; +encode_method_fields(#'exchange.bind_ok'{}) -> + <<>>; +encode_method_fields(#'exchange.unbind'{ticket = F0, destination = F1, source = F2, routing_key = F3, nowait = F4, arguments = F5}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + F4Bits = ((bitvalue(F4) bsl 0)), + F5Tab = rabbit_binary_generator:generate_table(F5), + F5Len = size(F5Tab), + <>; +encode_method_fields(#'exchange.unbind_ok'{}) -> + <<>>; +encode_method_fields(#'queue.declare'{ticket = F0, queue = F1, passive = F2, durable = F3, exclusive = F4, auto_delete = F5, nowait = F6, arguments = F7}) -> + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0) bor (bitvalue(F3) bsl 1) bor (bitvalue(F4) bsl 2) bor (bitvalue(F5) bsl 3) bor (bitvalue(F6) bsl 4)), + F7Tab = rabbit_binary_generator:generate_table(F7), + F7Len = size(F7Tab), + <>; +encode_method_fields(#'queue.declare_ok'{queue = F0, message_count = F1, consumer_count = F2}) -> + F0Len = shortstr_size(F0), + <>; +encode_method_fields(#'queue.bind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, nowait = F4, arguments = F5}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + F4Bits = ((bitvalue(F4) bsl 0)), + F5Tab = rabbit_binary_generator:generate_table(F5), + F5Len = size(F5Tab), + <>; +encode_method_fields(#'queue.bind_ok'{}) -> + <<>>; +encode_method_fields(#'queue.purge'{ticket = F0, queue = F1, nowait = F2}) -> + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0)), + <>; +encode_method_fields(#'queue.purge_ok'{message_count = F0}) -> + <>; +encode_method_fields(#'queue.delete'{ticket = F0, queue = F1, if_unused = F2, if_empty = F3, nowait = F4}) -> + F1Len = shortstr_size(F1), + F2Bits = ((bitvalue(F2) bsl 0) bor (bitvalue(F3) bsl 1) bor (bitvalue(F4) bsl 2)), + <>; +encode_method_fields(#'queue.delete_ok'{message_count = F0}) -> + <>; +encode_method_fields(#'queue.unbind'{ticket = F0, queue = F1, exchange = F2, routing_key = F3, arguments = F4}) -> + F1Len = shortstr_size(F1), + F2Len = shortstr_size(F2), + F3Len = shortstr_size(F3), + F4Tab = rabbit_binary_generator:generate_table(F4), + F4Len = size(F4Tab), + <>; +encode_method_fields(#'queue.unbind_ok'{}) -> + <<>>; +encode_method_fields(#'tx.select'{}) -> + <<>>; +encode_method_fields(#'tx.select_ok'{}) -> + <<>>; +encode_method_fields(#'tx.commit'{}) -> + <<>>; +encode_method_fields(#'tx.commit_ok'{}) -> + <<>>; +encode_method_fields(#'tx.rollback'{}) -> + <<>>; +encode_method_fields(#'tx.rollback_ok'{}) -> + <<>>; +encode_method_fields(#'confirm.select'{nowait = F0}) -> + F0Bits = ((bitvalue(F0) bsl 0)), + <>; +encode_method_fields(#'confirm.select_ok'{}) -> + <<>>; +encode_method_fields(Record) -> exit({unknown_method_name, element(1, Record)}). +encode_properties(#'P_basic'{content_type = F0, content_encoding = F1, headers = F2, delivery_mode = F3, priority = F4, correlation_id = F5, reply_to = F6, expiration = F7, message_id = F8, timestamp = F9, type = F10, user_id = F11, app_id = F12, cluster_id = F13}) -> + R0 = [<<>>], + {P0, R1} = if F0 =:= undefined -> {0, R0}; true -> {1, [?SHORTSTR_PROP(F0, L0) | R0]} end, + {P1, R2} = if F1 =:= undefined -> {0, R1}; true -> {1, [?SHORTSTR_PROP(F1, L1) | R1]} end, + {P2, R3} = if F2 =:= undefined -> {0, R2}; true -> {1, [?TABLE_PROP(F2, L2) | R2]} end, + {P3, R4} = if F3 =:= undefined -> {0, R3}; true -> {1, [?OCTET_PROP(F3, L3) | R3]} end, + {P4, R5} = if F4 =:= undefined -> {0, R4}; true -> {1, [?OCTET_PROP(F4, L4) | R4]} end, + {P5, R6} = if F5 =:= undefined -> {0, R5}; true -> {1, [?SHORTSTR_PROP(F5, L5) | R5]} end, + {P6, R7} = if F6 =:= undefined -> {0, R6}; true -> {1, [?SHORTSTR_PROP(F6, L6) | R6]} end, + {P7, R8} = if F7 =:= undefined -> {0, R7}; true -> {1, [?SHORTSTR_PROP(F7, L7) | R7]} end, + {P8, R9} = if F8 =:= undefined -> {0, R8}; true -> {1, [?SHORTSTR_PROP(F8, L8) | R8]} end, + {P9, R10} = if F9 =:= undefined -> {0, R9}; true -> {1, [?TIMESTAMP_PROP(F9, L9) | R9]} end, + {P10, R11} = if F10 =:= undefined -> {0, R10}; true -> {1, [?SHORTSTR_PROP(F10, L10) | R10]} end, + {P11, R12} = if F11 =:= undefined -> {0, R11}; true -> {1, [?SHORTSTR_PROP(F11, L11) | R11]} end, + {P12, R13} = if F12 =:= undefined -> {0, R12}; true -> {1, [?SHORTSTR_PROP(F12, L12) | R12]} end, + {P13, R14} = if F13 =:= undefined -> {0, R13}; true -> {1, [?SHORTSTR_PROP(F13, L13) | R13]} end, + list_to_binary([<> | lists:reverse(R14)]); +encode_properties(#'P_connection'{}) -> + <<>>; +encode_properties(#'P_channel'{}) -> + <<>>; +encode_properties(#'P_access'{}) -> + <<>>; +encode_properties(#'P_exchange'{}) -> + <<>>; +encode_properties(#'P_queue'{}) -> + <<>>; +encode_properties(#'P_tx'{}) -> + <<>>; +encode_properties(#'P_confirm'{}) -> + <<>>; +encode_properties(Record) -> exit({unknown_properties_record, Record}). +lookup_amqp_exception(content_too_large) -> {false, ?CONTENT_TOO_LARGE, <<"CONTENT_TOO_LARGE">>}; +lookup_amqp_exception(no_route) -> {false, ?NO_ROUTE, <<"NO_ROUTE">>}; +lookup_amqp_exception(no_consumers) -> {false, ?NO_CONSUMERS, <<"NO_CONSUMERS">>}; +lookup_amqp_exception(access_refused) -> {false, ?ACCESS_REFUSED, <<"ACCESS_REFUSED">>}; +lookup_amqp_exception(not_found) -> {false, ?NOT_FOUND, <<"NOT_FOUND">>}; +lookup_amqp_exception(resource_locked) -> {false, ?RESOURCE_LOCKED, <<"RESOURCE_LOCKED">>}; +lookup_amqp_exception(precondition_failed) -> {false, ?PRECONDITION_FAILED, <<"PRECONDITION_FAILED">>}; +lookup_amqp_exception(connection_forced) -> {true, ?CONNECTION_FORCED, <<"CONNECTION_FORCED">>}; +lookup_amqp_exception(invalid_path) -> {true, ?INVALID_PATH, <<"INVALID_PATH">>}; +lookup_amqp_exception(frame_error) -> {true, ?FRAME_ERROR, <<"FRAME_ERROR">>}; +lookup_amqp_exception(syntax_error) -> {true, ?SYNTAX_ERROR, <<"SYNTAX_ERROR">>}; +lookup_amqp_exception(command_invalid) -> {true, ?COMMAND_INVALID, <<"COMMAND_INVALID">>}; +lookup_amqp_exception(channel_error) -> {true, ?CHANNEL_ERROR, <<"CHANNEL_ERROR">>}; +lookup_amqp_exception(unexpected_frame) -> {true, ?UNEXPECTED_FRAME, <<"UNEXPECTED_FRAME">>}; +lookup_amqp_exception(resource_error) -> {true, ?RESOURCE_ERROR, <<"RESOURCE_ERROR">>}; +lookup_amqp_exception(not_allowed) -> {true, ?NOT_ALLOWED, <<"NOT_ALLOWED">>}; +lookup_amqp_exception(not_implemented) -> {true, ?NOT_IMPLEMENTED, <<"NOT_IMPLEMENTED">>}; +lookup_amqp_exception(internal_error) -> {true, ?INTERNAL_ERROR, <<"INTERNAL_ERROR">>}; +lookup_amqp_exception(Code) -> + rabbit_log:warning("Unknown AMQP error code '~p'~n", [Code]), + {true, ?INTERNAL_ERROR, <<"INTERNAL_ERROR">>}. +amqp_exception(?FRAME_METHOD) -> frame_method; +amqp_exception(?FRAME_HEADER) -> frame_header; +amqp_exception(?FRAME_BODY) -> frame_body; +amqp_exception(?FRAME_HEARTBEAT) -> frame_heartbeat; +amqp_exception(?FRAME_MIN_SIZE) -> frame_min_size; +amqp_exception(?FRAME_END) -> frame_end; +amqp_exception(?REPLY_SUCCESS) -> reply_success; +amqp_exception(?CONTENT_TOO_LARGE) -> content_too_large; +amqp_exception(?NO_ROUTE) -> no_route; +amqp_exception(?NO_CONSUMERS) -> no_consumers; +amqp_exception(?ACCESS_REFUSED) -> access_refused; +amqp_exception(?NOT_FOUND) -> not_found; +amqp_exception(?RESOURCE_LOCKED) -> resource_locked; +amqp_exception(?PRECONDITION_FAILED) -> precondition_failed; +amqp_exception(?CONNECTION_FORCED) -> connection_forced; +amqp_exception(?INVALID_PATH) -> invalid_path; +amqp_exception(?FRAME_ERROR) -> frame_error; +amqp_exception(?SYNTAX_ERROR) -> syntax_error; +amqp_exception(?COMMAND_INVALID) -> command_invalid; +amqp_exception(?CHANNEL_ERROR) -> channel_error; +amqp_exception(?UNEXPECTED_FRAME) -> unexpected_frame; +amqp_exception(?RESOURCE_ERROR) -> resource_error; +amqp_exception(?NOT_ALLOWED) -> not_allowed; +amqp_exception(?NOT_IMPLEMENTED) -> not_implemented; +amqp_exception(?INTERNAL_ERROR) -> internal_error; +amqp_exception(_Code) -> undefined. diff --git a/deps/rabbit_common/src/rabbit_writer.erl b/deps/rabbit_common/src/rabbit_writer.erl index 9ba99d1d33f4..1acbcee2d631 100644 --- a/deps/rabbit_common/src/rabbit_writer.erl +++ b/deps/rabbit_common/src/rabbit_writer.erl @@ -25,7 +25,6 @@ %% When a socket write fails, writer will exit. -include("rabbit.hrl"). --include("rabbit_framing.hrl"). -export([start/6, start_link/6, start/7, start_link/7, start/8, start_link/8]). diff --git a/deps/rabbitmq_codegen/amqp-rabbitmq-0.8.json b/deps/rabbitmq_codegen/amqp-rabbitmq-0.8.json deleted file mode 100644 index c0b30a5d448e..000000000000 --- a/deps/rabbitmq_codegen/amqp-rabbitmq-0.8.json +++ /dev/null @@ -1,659 +0,0 @@ -{ - "name": "AMQP", - "major-version": 8, - "minor-version": 0, - "port": 5672, - "copyright": [ - "Copyright (C) 2008-2020 VMware, Inc. or its affiliates.\n", - "\n", - "Permission is hereby granted, free of charge, to any person\n", - "obtaining a copy of this file (the \"Software\"), to deal in the\n", - "Software without restriction, including without limitation the \n", - "rights to use, copy, modify, merge, publish, distribute, \n", - "sublicense, and/or sell copies of the Software, and to permit \n", - "persons to whom the Software is furnished to do so, subject to \n", - "the following conditions:\n", - "\n", - "The above copyright notice and this permission notice shall be\n", - "included in all copies or substantial portions of the Software.\n", - "\n", - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", - "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", - "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", - "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", - "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", - "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", - "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", - "OTHER DEALINGS IN THE SOFTWARE.\n", - "\n", - "Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf\n", - "\n", - "b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf\n", - "http://twiststandards.org/?option=com_docman&task=cat_view&gid=28&Itemid=90\n", - "8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf\n", - "https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1\n"], - - "domains": [ - ["access-ticket", "short"], - ["bit", "bit"], - ["channel-id", "longstr"], - ["class-id", "short"], - ["consumer-tag", "shortstr"], - ["delivery-tag", "longlong"], - ["destination", "shortstr"], - ["duration", "longlong"], - ["exchange-name", "shortstr"], - ["known-hosts", "shortstr"], - ["long", "long"], - ["longlong", "longlong"], - ["longstr", "longstr"], - ["method-id", "short"], - ["no-ack", "bit"], - ["no-local", "bit"], - ["octet", "octet"], - ["offset", "longlong"], - ["path", "shortstr"], - ["peer-properties", "table"], - ["queue-name", "shortstr"], - ["redelivered", "bit"], - ["reference", "longstr"], - ["reject-code", "short"], - ["reject-text", "shortstr"], - ["reply-code", "short"], - ["reply-text", "shortstr"], - ["security-token", "longstr"], - ["short", "short"], - ["shortstr", "shortstr"], - ["table", "table"], - ["timestamp", "timestamp"] - ], - - "constants": [ - {"name": "FRAME-METHOD", "value": 1}, - {"name": "FRAME-HEADER", "value": 2}, - {"name": "FRAME-BODY", "value": 3}, - {"name": "FRAME-OOB-METHOD", "value": 4}, - {"name": "FRAME-OOB-HEADER", "value": 5}, - {"name": "FRAME-OOB-BODY", "value": 6}, - {"name": "FRAME-TRACE", "value": 7}, - {"name": "FRAME-HEARTBEAT", "value": 8}, - {"name": "FRAME-MIN-SIZE", "value": 4096}, - {"name": "FRAME-END", "value": 206}, - {"name": "REPLY-SUCCESS", "value": 200}, - {"name": "NOT-DELIVERED", "value": 310, "class": "soft-error"}, - {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"}, - {"name": "NO-ROUTE", "value": 312, "class": "soft-error"}, - {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"}, - {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"}, - {"name": "NOT-FOUND", "value": 404, "class": "soft-error"}, - {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"}, - {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"}, - {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"}, - {"name": "INVALID-PATH", "value": 402, "class": "hard-error"}, - {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"}, - {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"}, - {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"}, - {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"}, - {"name": "UNEXPECTED-FRAME", "value": 505, "class": "hard-error"}, - {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"}, - {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"}, - {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"}, - {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"} - ], - - "classes": [ - { - "id": 10, - "methods": [{"id": 10, - "arguments": [{"type": "octet", "name": "version-major", "default-value": 0}, - {"type": "octet", "name": "version-minor", "default-value": 8}, - {"domain": "peer-properties", "name": "server-properties"}, - {"type": "longstr", "name": "mechanisms", "default-value": "PLAIN"}, - {"type": "longstr", "name": "locales", "default-value": "en_US"}], - "name": "start", - "synchronous" : true}, - {"id": 11, - "arguments": [{"domain": "peer-properties", "name": "client-properties"}, - {"type": "shortstr", "name": "mechanism", "default-value": "PLAIN"}, - {"type": "longstr", "name": "response"}, - {"type": "shortstr", "name": "locale", "default-value": "en_US"}], - "name": "start-ok"}, - {"id": 20, - "arguments": [{"type": "longstr", "name": "challenge"}], - "name": "secure", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "longstr", "name": "response"}], - "name": "secure-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, - {"type": "long", "name": "frame-max", "default-value": 0}, - {"type": "short", "name": "heartbeat", "default-value": 0}], - "name": "tune", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, - {"type": "long", "name": "frame-max", "default-value": 0}, - {"type": "short", "name": "heartbeat", "default-value": 0}], - "name": "tune-ok"}, - {"id": 40, - "arguments": [{"type": "shortstr", "name": "virtual-host", "default-value": "/"}, - {"type": "shortstr", "name": "capabilities", "default-value": ""}, - {"type": "bit", "name": "insist", "default-value": false}], - "name": "open", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "shortstr", "name": "known-hosts", "default-value": ""}], - "name": "open-ok"}, - {"id": 50, - "arguments": [{"type": "shortstr", "name": "host"}, - {"type": "shortstr", "name": "known-hosts", "default-value": ""}], - "name": "redirect"}, - {"id": 60, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "short", "name": "class-id"}, - {"type": "short", "name": "method-id"}], - "name": "close", - "synchronous" : true}, - {"id": 61, - "arguments": [], - "name": "close-ok"}], - "name": "connection", - "properties": [] - }, - { - "id": 20, - "methods": [{"id": 10, - "arguments": [{"type": "shortstr", "name": "out-of-band", "default-value": ""}], - "name": "open", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "open-ok"}, - {"id": 20, - "arguments": [{"type": "bit", "name": "active"}], - "name": "flow", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "bit", "name": "active"}], - "name": "flow-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "table", "name": "details", "default-value": {}}], - "name": "alert"}, - {"id": 40, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "short", "name": "class-id"}, - {"type": "short", "name": "method-id"}], - "name": "close", - "synchronous" : true}, - {"id": 41, - "arguments": [], - "name": "close-ok"}], - "name": "channel" - }, - { - "id": 30, - "methods": [{"id": 10, - "arguments": [{"type": "shortstr", "name": "realm", "default-value": "/data"}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "passive", "default-value": true}, - {"type": "bit", "name": "active", "default-value": true}, - {"type": "bit", "name": "write", "default-value": true}, - {"type": "bit", "name": "read", "default-value": true}], - "name": "request", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}], - "name": "request-ok"}], - "name": "access" - }, - { - "id": 40, - "methods": [{"id": 10, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "type", "default-value": "direct"}, - {"type": "bit", "name": "passive", "default-value": false}, - {"type": "bit", "name": "durable", "default-value": false}, - {"type": "bit", "name": "auto-delete", "default-value": false}, - {"type": "bit", "name": "internal", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "declare", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "declare-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange"}, - {"type": "bit", "name": "if-unused", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "delete", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "delete-ok"}], - "name": "exchange" - }, - { - "id": 50, - "methods": [{"id": 10, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "bit", "name": "passive", "default-value": false}, - {"type": "bit", "name": "durable", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "auto-delete", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "declare", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "shortstr", "name": "queue"}, - {"type": "long", "name": "message-count"}, - {"type": "long", "name": "consumer-count"}], - "name": "declare-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "nowait", "default-value": false}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "bind", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "bind-ok"}, - {"id": 30, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "purge", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "long", "name": "message-count"}], - "name": "purge-ok"}, - {"id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "bit", "name": "if-unused", "default-value": false}, - {"type": "bit", "name": "if-empty", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "delete", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "long", "name": "message-count"}], - "name": "delete-ok"}, - {"id": 50, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "table", "name": "arguments", "default-value": {}}], - "name": "unbind", - "synchronous" : true}, - {"id": 51, - "arguments": [], - "name": "unbind-ok"} - ], - "name": "queue" - }, - { - "id": 60, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"domain": "access-ticket", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "no-ack", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"content": true, - "id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}], - "name": "publish"}, - {"content": true, - "id": 50, - "arguments": [{"type": "short", "name": "reply-code"}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"content": true, - "id": 60, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "deliver"}, - {"id": 70, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "bit", "name": "no-ack", "default-value": false}], - "name": "get", - "synchronous" : true}, - {"content": true, - "id": 71, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}, - {"type": "long", "name": "message-count"}], - "name": "get-ok"}, - {"id": 72, - "arguments": [{"type": "shortstr", "name": "cluster-id", "default-value": ""}], - "name": "get-empty"}, - {"id": 80, - "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, - {"type": "bit", "name": "multiple", "default-value": false}], - "name": "ack"}, - {"id": 90, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "requeue", "default-value": true}], - "name": "reject"}, - {"id": 100, - "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], - "name": "recover-async"}, - {"id": 110, - "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], - "name": "recover", - "synchronous" : true}, - {"id": 111, - "arguments": [], - "name": "recover-ok"}], - "name": "basic", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "delivery-mode"}, - {"type": "octet", "name": "priority"}, - {"type": "shortstr", "name": "correlation-id"}, - {"type": "shortstr", "name": "reply-to"}, - {"type": "shortstr", "name": "expiration"}, - {"type": "shortstr", "name": "message-id"}, - {"type": "timestamp", "name": "timestamp"}, - {"type": "shortstr", "name": "type"}, - {"type": "shortstr", "name": "user-id"}, - {"type": "shortstr", "name": "app-id"}, - {"type": "shortstr", "name": "cluster-id"}] - }, - { - "id": 70, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "no-ack", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"id": 40, - "arguments": [{"type": "shortstr", "name": "identifier"}, - {"type": "longlong", "name": "content-size"}], - "name": "open", - "synchronous" : true}, - {"id": 41, - "arguments": [{"type": "longlong", "name": "staged-size"}], - "name": "open-ok"}, - {"content": true, - "id": 50, - "arguments": [], - "name": "stage"}, - {"id": 60, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}, - {"type": "shortstr", "name": "identifier"}], - "name": "publish"}, - {"content": true, - "id": 70, - "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"id": 80, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "redelivered", "default-value": false}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}, - {"type": "shortstr", "name": "identifier"}], - "name": "deliver"}, - {"id": 90, - "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, - {"type": "bit", "name": "multiple", "default-value": false}], - "name": "ack"}, - {"id": 100, - "arguments": [{"type": "longlong", "name": "delivery-tag"}, - {"type": "bit", "name": "requeue", "default-value": true}], - "name": "reject"}], - "name": "file", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "priority"}, - {"type": "shortstr", "name": "reply-to"}, - {"type": "shortstr", "name": "message-id"}, - {"type": "shortstr", "name": "filename"}, - {"type": "timestamp", "name": "timestamp"}, - {"type": "shortstr", "name": "cluster-id"}] - }, - { - "id": 80, - "methods": [{"id": 10, - "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, - {"type": "short", "name": "prefetch-count", "default-value": 0}, - {"type": "long", "name": "consume-rate", "default-value": 0}, - {"type": "bit", "name": "global", "default-value": false}], - "name": "qos", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "qos-ok"}, - {"id": 20, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "queue", "default-value": ""}, - {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, - {"type": "bit", "name": "no-local", "default-value": false}, - {"type": "bit", "name": "exclusive", "default-value": false}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "consume", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "consume-ok"}, - {"id": 30, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "bit", "name": "nowait", "default-value": false}], - "name": "cancel", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}], - "name": "cancel-ok"}, - {"content": true, - "id": 40, - "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, - {"type": "shortstr", "name": "exchange", "default-value": ""}, - {"type": "shortstr", "name": "routing-key", "default-value": ""}, - {"type": "bit", "name": "mandatory", "default-value": false}, - {"type": "bit", "name": "immediate", "default-value": false}], - "name": "publish"}, - {"content": true, - "id": 50, - "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, - {"type": "shortstr", "name": "reply-text", "default-value": ""}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "routing-key"}], - "name": "return"}, - {"content": true, - "id": 60, - "arguments": [{"type": "shortstr", "name": "consumer-tag"}, - {"type": "longlong", "name": "delivery-tag"}, - {"type": "shortstr", "name": "exchange"}, - {"type": "shortstr", "name": "queue"}], - "name": "deliver"}], - "name": "stream", - "properties": [{"type": "shortstr", "name": "content-type"}, - {"type": "shortstr", "name": "content-encoding"}, - {"type": "table", "name": "headers"}, - {"type": "octet", "name": "priority"}, - {"type": "timestamp", "name": "timestamp"}] - }, - { - "id": 90, - "methods": [{"id": 10, - "arguments": [], - "name": "select", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "select-ok"}, - {"id": 20, - "arguments": [], - "name": "commit", - "synchronous" : true}, - {"id": 21, - "arguments": [], - "name": "commit-ok"}, - {"id": 30, - "arguments": [], - "name": "rollback", - "synchronous" : true}, - {"id": 31, - "arguments": [], - "name": "rollback-ok"}], - "name": "tx" - }, - { - "id": 100, - "methods": [{"id": 10, - "arguments": [], - "name": "select", - "synchronous" : true}, - {"id": 11, - "arguments": [], - "name": "select-ok"}, - {"id": 20, - "arguments": [{"type": "shortstr", "name": "dtx-identifier"}], - "name": "start", - "synchronous" : true}, - {"id": 21, - "arguments": [], "name": "start-ok"}], - "name": "dtx" - }, - { - "id": 110, - "methods": [{"content": true, - "id": 10, - "arguments": [{"type": "table", "name": "meta-data"}], - "name": "request"}], - "name": "tunnel", - "properties": [{"type": "table", "name": "headers"}, - {"type": "shortstr", "name": "proxy-name"}, - {"type": "shortstr", "name": "data-name"}, - {"type": "octet", "name": "durable"}, - {"type": "octet", "name": "broadcast"}] - }, - { - "id": 120, - "methods": [{"id": 10, - "arguments": [{"type": "octet", "name": "integer-1"}, - {"type": "short", "name": "integer-2"}, - {"type": "long", "name": "integer-3"}, - {"type": "longlong", "name": "integer-4"}, - {"type": "octet", "name": "operation"}], - "name": "integer", - "synchronous" : true}, - {"id": 11, - "arguments": [{"type": "longlong", "name": "result"}], - "name": "integer-ok"}, - {"id": 20, - "arguments": [{"type": "shortstr", "name": "string-1"}, - {"type": "longstr", "name": "string-2"}, - {"type": "octet", "name": "operation"}], - "name": "string", - "synchronous" : true}, - {"id": 21, - "arguments": [{"type": "longstr", "name": "result"}], - "name": "string-ok"}, - {"id": 30, - "arguments": [{"type": "table", "name": "table"}, - {"type": "octet", "name": "integer-op"}, - {"type": "octet", "name": "string-op"}], - "name": "table", - "synchronous" : true}, - {"id": 31, - "arguments": [{"type": "longlong", "name": "integer-result"}, - {"type": "longstr", "name": "string-result"}], - "name": "table-ok"}, - {"content": true, - "id": 40, - "arguments": [], - "name": "content", - "synchronous" : true}, - {"content": true, - "id": 41, - "arguments": [{"type": "long", "name": "content-checksum"}], - "name": "content-ok"}], - "name": "test" - } - ] -}