Skip to content

Instantly share code, notes, and snippets.

View hairyhum's full-sized avatar

Daniil Fedotov hairyhum

  • Ockam
  • 20:22 (UTC -04:00)
View GitHub Profile

Cluster state on disk:

  1. Mnesia schema db_nodes - nodes of the schema. Either disk nodes or nodes where tables are replicated to. extra_db_nodes - configuration telling mnesia which nodes to connect to on startup. running_db_nodes - nodes which mnesia is currently connected to. [1] table nodes - nodes on which tables are replicated. A list with all nodes, and with "active" nodes. "all nodes" is a subset of db_nodes, "active nodes" is a subset of running_db_nodes In a way db_nodes and running_db_nodes are same as
Slave processes can only send confirms.
There is no way to tell that the message should be rejected.
Slave processes react to discard by confirming message, because discard
is used for messages which were acked before enqueue
for example when delivered to a no-ack consumer.
Enqueue:
Master Slave Channel
| | publish | <- publish
RabbitMQ queue types.
As 3.8 release with new quorum queue type approaches, the RabbitMQ team
was thinking of introducing a new concept for RabbitMQ: queue types.
Currently queues have many different settings, configured with arguments and
policies. These settings allow you to configure queues to be used in different
scenarios and have different behaviours.
For example mirrored/unmirrored, lazy, queues with limits and TTLs.
defmodule App do
@moduledoc """
Documentation for App.
"""
@doc """
Hello world.
## Examples
@hairyhum
hairyhum / schema_test.erl
Last active May 8, 2019 14:44
Simple perf test for rabbitmq schema storage.
-module(schema_test).
-export([declare_queues/3, add_binding/3]).
-include_lib("amqp_client/include/amqp_client.hrl").
% -include_lib("rabbit_common/include/rabbit.hrl").
-define(QNAME, <<"foo">>).
-define(XNAME, <<"foo">>).
## Jobs
<%# packages %>
<%# packagecloud %>
- name: publish-<% release_name %>-<% package_type %>-package-to-packagecloud
serial: true
serial_groups: [releases]
plan:
- get: rabbitmq-ci
- name: publish-alpha-debian-package-to-packagecloud
serial: true
serial_groups: [releases]
plan:
- get: rabbitmq-ci
- get: dev-deliverable-package-debian
passed: [copy-alpha-package-debian]
- get: dev-version
passed: [copy-alpha-package-debian]
- get: dev-package-buildnum
- name: dev-debian-package-on-packagecloud:debian/wheezy
type: packagecloud-package
source:
username: ((packagecloud_username))
api_key: ((packagecloud_api_key))
repo: rabbitmq-server-dev
distribution_name: debian/wheezy
- name: dev-debian-package-on-packagecloud:debian/jessie
type: packagecloud-package
-module(mnesia_consensus).
-behaviour(mnesia_access).
%% Mnesia access callbacks.
%% When mnesia:Fun is called inside an activity - it calls a module callback.
%% The callback can forward the call to the next level or do anything.
-export([
lock/4,
write/5, delete/5, delete_object/5,

Update for OTP-20 compatibility.

Recently the OTP team had reverted the change to term_to_binary, which caused the incompatibility. You can see this commit for more info https://github.com/erlang/otp/commit/48e67f5dd1d20b9a1f78c5a97cc7ed4afb489ba5

The term_to_binary/2 function now has another minor_version option 2, which will generate the new format, while version 1, generating the old one, is the default version for term_to_binary/1.