Commit Graph

432 Commits

Author SHA1 Message Date
Philip Kuryloski 15a79466b1 Use the new xref2 macro from rules_erlang
That adopts the modern erlang.mk xref behaviour
2022-06-09 23:18:28 +02:00
Philip Kuryloski 327f075d57 Make rabbitmq-server work with rules_erlang 3
Also rework elixir dependency handling, so we no longer rely on mix to
fetch the rabbitmq_cli deps

Also:

- Specify ra version with a commit rather than a branch
- Fixup compilation options for erlang 23
- Add missing ra reference in MODULE.bazel
- Add missing flag in oci.yaml
- Reduce bazel rbe jobs to try to save memory
- Use bazel built erlang for erlang git master tests
- Use the same cache for all the workflows but windows
- Avoid using `mix local.hex --force` in elixir rules
  - Fetching seems blocked in CI, and this should reduce hex api usage in
    all builds, which is always nice
- Remove xref and dialyze tags since rules_erlang 3 includes them in
  the defaults
2022-06-08 14:04:53 +02:00
Loïc Hoguin dc70cbf281
Update Erlang.mk and switch to new xref code 2022-05-31 13:51:12 +02:00
Michael Klishin 7c47d0925a
Revert "Correct a double quote introduced in #4603"
This reverts commit 6a44e0e2ef.

That wiped a lot of files unintentionally
2022-04-20 16:05:56 +04:00
Michael Klishin 6a44e0e2ef
Correct a double quote introduced in #4603 2022-04-20 16:01:29 +04:00
Luke Bakken dba25f6462
Replace files with symlinks
This prevents duplicated and out-of-date instructions.
2022-04-15 06:04:29 -07:00
Philip Kuryloski 2dd9bde891 Bring over PROJECT_APP_EXTRA_KEYS values from make to bazel 2022-04-07 17:39:33 +02:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Philip Kuryloski 078321cce5 Attempt to reduce test flakes in consistent_hash_exchange suite 2022-03-11 15:37:00 +01:00
Philip Kuryloski dabf053cf8 Additional dialyzer warning fixes
Currently loading of the rabbitmq_cli defined behaviors compiled with
Elixir does not work, so we ignore the callback definitions contained therein
2022-02-25 18:14:35 +01:00
Philip Kuryloski 226e00fcd2 Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps
2022-02-24 11:18:41 +01:00
Philip Kuryloski d8201726ae Ignore dialyzer warnings for most apps 2022-02-21 09:19:56 +01:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Michael Klishin 87325b09f7
Improve a comment 2021-10-19 23:03:47 +03:00
Falcon Taylor-Carter 43b10615be Fix binding deletion in duplicate-binding scenarios 2021-10-18 23:25:27 -04:00
Falcon Taylor-Carter 4dab02289d Add tests for duplicate binding scenarios 2021-10-18 23:25:06 -04:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
Philip Kuryloski 30f9a95b9f Add dialyze for remaning tier-1 plugins 2021-06-01 10:19:10 +02:00
Michael Klishin 7f0d9fa1e7
{consistent_hash,recent_history}_exchange plugins: add retries to schema sync
So, do what RabbitMQ core does as of 3.6.7 or so.

This makes it possible for nodes with those plugins enabled to be
restarted in arbitrary order within a certain time window, just
like nodes without those plugins.
2021-05-26 20:49:14 +03:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Philip Kuryloski c13c2af614 Bazel file refactoring 2021-05-11 12:03:27 +02:00
Philip Kuryloski a57f62eafa Refactor rabbitmq_consistent_hash_exchange bazel 2021-05-11 10:58:12 +02:00
Philip Kuryloski 072a1c0462 Refactor and dedupe .bazel file content 2021-04-16 10:22:44 +02:00
Philip Kuryloski 3ecb291d75 Add rabbitmq_consistent_hash_exchange to bazel
also fixup erlc_opts for some other plugins
2021-04-08 17:24:14 +02:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
kjnilsson 52f745dcde Update rabbitmq-components.mk
use v1.x branch of ra
2021-03-18 15:14:40 +00:00
Loïc Hoguin d5e3bdd623
Add ADDITIONAL_PLUGINS variable
This allows including additional applications or third party
plugins when creating a release, running the broker locally,
or just building from the top-level Makefile.

To include Looking Glass in a release, for example:

$ make package-generic-unix ADDITIONAL_PLUGINS="looking_glass"

A Docker image can then be built using this release and will
contain Looking Glass:

$ make docker-image

Beware macOS users! Applications such as Looking Glass include
NIFs. NIFs must be compiled in the right environment. If you
are building a Docker image then make sure to build the NIF
on Linux! In the two steps above, this corresponds to Step 1.

To run the broker with Looking Glass available:

$ make run-broker ADDITIONAL_PLUGINS="looking_glass"

This commit also moves Looking Glass dependency information
into rabbitmq-components.mk so it is available at all times.
2021-03-12 12:29:28 +01:00
Jean-Sébastien Pédron cdcf602749
Switch from Lager to the new Erlang Logger API for logging
The configuration remains the same for the end-user. The only exception
is the log root directory: it is now set through the `log_root`
application env. variable in `rabbit`. People using the Cuttlefish-based
configuration file are not affected by this exception.

The main change is how the logging facility is configured. It now
happens in `rabbit_prelaunch_logging`. The `rabbit_lager` module is
removed.

The supported outputs remain the same: the console, text files, the
`amq.rabbitmq.log` exchange and syslog.

The message text format slightly changed: the timestamp is more precise
(now to the microsecond) and the level can be abbreviated to always be
4-character long to align all messages and improve readability. Here is
an example:

    2021-03-03 10:22:30.377392+01:00 [dbug] <0.229.0> == Prelaunch DONE ==
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Starting RabbitMQ 3.8.10+115.g071f3fb on Erlang 23.2.5
    2021-03-03 10:22:30.377860+01:00 [info] <0.229.0>  Licensed under the MPL 2.0. Website: https://rabbitmq.com

The example above also shows that multiline messages are supported and
each line is prepended with the same prefix (the timestamp, the level
and the Erlang process PID).

JSON is also supported as a message format and now for any outputs.
Indeed, it is possible to use it with e.g. syslog or the exchange. Here
is an example of a JSON-formatted message sent to syslog:

    Mar  3 11:23:06 localhost rabbitmq-server[27908] <0.229.0> - {"time":"2021-03-03T11:23:06.998466+01:00","level":"notice","msg":"Logging: configured log handlers are now ACTIVE","meta":{"domain":"rabbitmq.prelaunch","file":"src/rabbit_prelaunch_logging.erl","gl":"<0.228.0>","line":311,"mfa":["rabbit_prelaunch_logging","configure_logger",1],"pid":"<0.229.0>"}}

For quick testing, the values accepted by the `$RABBITMQ_LOGS`
environment variables were extended:
  * `-` still means stdout
  * `-stderr` means stderr
  * `syslog:` means syslog on localhost
  * `exchange:` means logging to `amq.rabbitmq.log`

`$RABBITMQ_LOG` was also extended. It now accepts a `+json` modifier (in
addition to the existing `+color` one). With that modifier, messages are
formatted as JSON intead of plain text.

The `rabbitmqctl rotate_logs` command is deprecated. The reason is
Logger does not expose a function to force log rotation. However, it
will detect when a file was rotated by an external tool.

From a developer point of view, the old `rabbit_log*` API remains
supported, though it is now deprecated. It is implemented as regular
modules: there is no `parse_transform` involved anymore.

In the code, it is recommended to use the new Logger macros. For
instance, `?LOG_INFO(Format, Args)`. If possible, messages should be
augmented with some metadata. For instance (note the map after the
message):

    ?LOG_NOTICE("Logging: switching to configured handler(s); following "
                "messages may not be visible in this log output",
                #{domain => ?RMQLOG_DOMAIN_PRELAUNCH}),

Domains in Erlang Logger parlance are the way to categorize messages.
Some predefined domains, matching previous categories, are currently
defined in `rabbit_common/include/logging.hrl` or headers in the
relevant plugins for plugin-specific categories.

At this point, very few messages have been converted from the old
`rabbit_log*` API to the new macros. It can be done gradually when
working on a particular module or logging.

The Erlang builtin console/file handler, `logger_std_h`, has been forked
because it lacks date-based file rotation. The configuration of
date-based rotation is identical to Lager. Once the dust has settled for
this feature, the goal is to submit it upstream for inclusion in Erlang.
The forked module is calld `rabbit_logger_std_h` and is based
`logger_std_h` in Erlang 23.0.
2021-03-11 15:17:36 +01:00
dcorbacho 61f7b2a723 Update to ranch 2.0 2021-03-08 23:11:05 +01:00
Michael Klishin b6c4831e75
Bump Lager to 3.9.1 2021-03-04 04:36:39 +03:00
Loïc Hoguin 66ac1bf5e9
Bump observer_cli to 1.6.1
More responsive when the system is overloaded with file calls.
2021-03-01 21:55:27 +03:00
Michael Klishin 8fe3df9343
Upgrade Lager to 3.9.0 for OTP 24 compatibility
`lager_util:expand_path/1` use changes are
due to erlang-lager/lager#540
2021-02-26 00:52:15 +03:00
Michael Klishin f73e851f9c
Bump observer_cli to 1.6.0 2021-02-24 12:53:55 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
Arnaud Cogoluègnes b921ac11a8
Merge pull request #2712 from rabbitmq/rabbitmq-stream-prometheus
Add stream prometheus plugin
2021-01-27 16:46:37 +01:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Arnaud Cogoluègnes bf72683eb2
Add stream prometheus plugin 2021-01-11 16:49:56 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Jean-Sébastien Pédron 47686ee1f0
Remove unused .github directories
They were valid until the switch to the "monorepository" when everything
was merged into a single Git repository.
2020-11-17 13:33:16 +01:00
Jean-Sébastien Pédron 1cfb526a48 rabbit_exchange_type_consistent_hash_SUITE: Bump wait_for_confirms to 5 minutes
We still get failures in CI. Let's see how it goes with a very large
timeout value.
2020-11-04 17:29:49 +01:00
Jean-Sébastien Pédron de1cccff7a rabbit_exchange_type_consistent_hash_SUITE: Use ?assertEqual instead of matching
The reported error will provide more information.
2020-11-04 17:28:42 +01:00
Jean-Sébastien Pédron cd6c8e25cf rabbit_exchange_type_consistent_hash_SUITE: Remove trailing whitespaces 2020-11-04 17:28:18 +01:00
Jean-Sébastien Pédron c7354f0f45 rabbit_exchange_type_consistent_hash_SUITE: Wait for confirms for 60 seconds
Switching from 5000 seconds to 5 seconds, after we discovered that this
API expects seconds instead of milliseconds, made the wait too short.
2020-11-04 11:06:13 +01:00
Michael Klishin a24cd2bf90 Merge pull request #50 from rabbitmq/lrb-confirm-timeout-is-seconds
wait_for_confirms timeout is in seconds
2020-11-03 17:47:48 +03:00
Arnaud Cogoluègnes d1b5ce204d Update rabbitmq-components.mk 2020-11-03 14:27:37 +01:00
Luke Bakken 868bd77859 wait_for_confirms timeout is in seconds
References rabbitmq/rabbitmq-erlang-client#138

cc @dumbbell
2020-11-02 10:49:50 -08:00
Michael Klishin d7ae13fdcb Update rabbitmq-components.mk 2020-10-21 12:55:33 +03:00
Luke Bakken aa1f0e1629 Update rabbitmq-components.mk 2020-08-04 08:41:46 -07:00
Jean-Sébastien Pédron 7bb6e88b53 Update rabbitmq-components.mk 2020-07-30 12:06:52 +02:00
Luke Bakken c8892fa553 Update rabbitmq-components.mk 2020-07-29 10:02:02 -07:00
dcorbacho 49ae4d09b8 Update erlang.mk 2020-07-21 14:32:09 +01:00
Michael Klishin 8fe3bb835d Update rabbitmq-components.mk 2020-07-21 13:12:45 +03:00
Michael Klishin 50225ffd22 Update rabbitmq-components.mk 2020-07-21 03:42:50 +03:00
dcorbacho 47555d85de Revert drop of Exhibit B on MPL 2.0 2020-07-20 16:58:14 +01:00
dcorbacho 288ba8789b Update LICENSE 2020-07-20 10:52:32 +01:00
Michael Klishin 62be8fb42a Update MPL2 license file, drop Exhibit B
and add a VMware copyright notice.

We did not mean to make this code Incompatible with Secondary Licenses
as defined in [1].

1. https://www.mozilla.org/en-US/MPL/2.0/FAQ/
2020-07-17 14:53:03 +03:00
dcorbacho 5d348bd3a1 Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-11 19:45:03 +01:00
Jean-Sébastien Pédron 9026c6dc91 Update erlang.mk 2020-06-23 17:13:41 +02:00
Michael Klishin a2401b39ac README updates 2020-06-13 17:28:11 +03:00
Michael Klishin de157d1263 Cosmetics 2020-06-13 16:11:16 +03:00
Michael Klishin 66931ab5ec Introduce a CLI command for consistent hashing ring inspection 2020-06-13 16:08:14 +03:00
Michael Klishin 882492558d Python examples: bump Pika to 1.1 2020-06-12 13:28:08 +03:00
Michael Klishin 2d0adc176b Integration tests for #45 2020-06-12 13:00:21 +03:00
Michael Klishin b61edd9782 Formatting 2020-06-12 12:57:32 +03:00
Michael Klishin 8f1e2d1898 Improve formatting of exchange source and destination in a log message 2020-06-12 12:55:25 +03:00
Michael Klishin c062583d95 Explain 2020-06-12 10:43:25 +03:00
Michael Klishin 4cb9b001d7 Manually recover ring state from durable exchanges and bindings
Only relevant for some use cases post-3.8.4 which has moved
plugin activation to a later point in the boot cycle, after
topology recovery.

Previously this state was naturally recovered during the topology
recovery boot step.

Closes #45.
2020-06-12 10:39:53 +03:00
Michael Klishin 6df9370c6c Mention routing locality in the README
References #32 and specifically [1].

1. https://github.com/rabbitmq/rabbitmq-consistent-hash-exchange/issues/32#issuecomment-643074328
2020-06-12 08:39:12 +03:00
Michael Klishin 1b54c9a2f5 Ditto for the Python example 2020-06-11 19:38:31 +03:00
Michael Klishin 9eb9a4660c Explain what the [Ruby] example does 2020-06-11 19:36:55 +03:00
Michael Klishin 98be220b50 Update Bunny dependency 2020-06-11 19:36:42 +03:00
Michael Klishin 2d5e015791 Update rabbitmq-components.mk 2020-06-10 19:51:15 +03:00
Jean-Sébastien Pédron f73587775a Update copyright (year 2020) 2020-03-10 16:08:09 +01:00
Gerhard Lazu d9e06337e0 Update rabbitmq-components.mk 2020-03-06 09:19:14 +00:00
Gerhard Lazu 00b26fc9bf Update erlang.mk 2020-03-06 09:17:29 +00:00
Jean-Sébastien Pédron 1f711c8fe0 Travis CI: Update config from rabbitmq-common 2020-03-04 14:24:27 +01:00
Jean-Sébastien Pédron f1df2f9e88 Travis CI: Update config from rabbitmq-common 2020-03-04 11:17:14 +01:00
Jean-Sébastien Pédron 6331101208 Travis CI: Update config from rabbitmq-common 2020-03-03 14:53:38 +01:00
Gerhard Lazu 518e124810 Update rabbitmq-components.mk 2020-02-11 15:31:43 +00:00
Michael Klishin 8c28dff573 (c) bump 2019-12-29 05:50:26 +03:00
Jean-Sébastien Pédron b0df8b3893 Git: Ignore copied CLI 2019-12-12 13:27:39 +01:00
Jean-Sébastien Pédron 6a55ef18e6 Update rabbitmq-components.mk 2019-12-12 13:14:53 +01:00
kjnilsson d84a531d1d Update rabbitmq-components.mk 2019-09-13 10:24:17 +01:00
kjnilsson e80156dbfd Update rabbitmq-components.mk 2019-09-04 10:30:54 +01:00
Jean-Sébastien Pédron fa5db839a0 Update erlang.mk 2019-08-29 20:44:58 +02:00
Michael Klishin a180dc5ab5 Update rabbitmq-components.mk 2019-08-11 01:47:51 +10:00
Jean-Sébastien Pédron 27533feef3 Update erlang.mk 2019-08-02 09:53:41 +02:00
Michael Klishin b45765ead7 Update rabbitmq-components.mk 2019-08-01 17:13:12 +03:00
Arnaud Cogoluègnes bea4abae24 Update rabbitmq-components.mk 2019-07-09 16:05:53 +02:00
Jean-Sébastien Pédron d6080a0af0 Update rabbitmq-components.mk 2019-06-28 16:05:27 +02:00
Jean-Sébastien Pédron 7e74ba9785 Update erlang.mk 2019-06-28 16:01:52 +02:00
Gerhard Lazu 468358361d Update rabbitmq-components.mk 2019-06-03 02:23:34 +01:00
Jean-Sébastien Pédron f90ce74486 Update rabbitmq-components.mk 2019-05-17 15:17:15 +02:00
Michael Klishin c91c3a6488 Update rabbitmq-components.mk 2019-05-17 08:36:30 +03:00
Michael Klishin 1797522427 Update rabbitmq-components.mk 2019-05-16 23:22:46 +03:00
Michael Klishin 0797fa32c5 Update rabbitmq-components.mk 2019-05-14 11:50:43 +03:00
Michael Klishin 8bd9ef97a6 Update rabbitmq-components.mk 2019-05-13 16:40:28 +03:00
Gerhard Lazu 3f3fe2c2c9 Update rabbitmq-components.mk 2019-05-01 13:18:10 +01:00
Luke Bakken 252bd79b60 Update rabbitmq-components.mk 2019-04-30 16:20:54 -07:00
Jean-Sébastien Pédron 2d3c774f97 Update rabbitmq-components.mk 2019-04-30 14:47:27 +02:00