Commit Graph

56 Commits

Author SHA1 Message Date
Michael Klishin 968eefa1bb
Bump (c) line year
There are no functional changes to this massive diff.
2025-01-01 17:54:10 -05:00
Michael Klishin eb261acd30
CLI: update guide URLs to use the new path structure
the original paths, e.g. /streams.html, do have redirects
in place but it turned out to be a surprisingly fragile
Cloudflare feature when there are hundreds of them,
so we better switch now.
2024-03-07 15:53:14 -05:00
Michal Kuratczyk 2e8ff3aaee
Add queue type setting for exchange federation
Remove x-ha-policy (ignored since RabbitMQ 3.0)
2024-03-04 17:31:17 +01:00
Michael Klishin 7b151a7651 More missed (c) header updates 2024-01-22 23:44:47 -05:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04: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
Michael Klishin 98724eff09
pg2 => pg for OTP 24 compatibility
there is still one failing queue federation test.
2021-03-03 19:01:12 +03:00
Michael Klishin a9dd03bdf5
Make it possible to use a single channel for message transfers and commands
For the rare case where federated exchange experience rapid
binding changes. As of rabbitmq/rabbitmq-federation#97,
such environments have a race condition between binding
and message propagation.
2021-02-20 00:42:39 +03:00
Michael Klishin b11a79cccf
Bump (c) year in header files 2021-02-04 07:04:58 +03:00
Michael Klishin cfcbee18fa Use a combination of cluster name and virtual host when detecting cycles
This makes it possible to federate messages between more than two
virtual hosts in a single cluster. Previously cycle detection would
drop messages that have traversed a "hop" (federation link)
in the same cluster.

Pair: @lukebakken.
2020-09-08 21:13:43 +03:00
dcorbacho 26a4365188 Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-12 22:52:53 +01:00
Michael Klishin 3e1cd1d566 Introduce a new upstream parameter, resource-cleanup-mode
Set it to 'never' to make sure the link never removes its internal queue.
It's highly advisable to then specify queue expiration (TTL) to avoid
resource leaks.
2020-04-04 02:18:05 +03:00
Jean-Sébastien Pédron c278947717 Update copyright (year 2020) 2020-03-10 16:10:02 +01:00
Michael Klishin 8b5bd10c43 (c) bump 2019-12-29 05:50:28 +03:00
Daniil Fedotov 04adb8fa6a Custom consumer tag for federaion.
Consumer tag is currently generated from the upstream name.
Consumer tag serves to identify a downsream from the upstream queue,
while upsream name identifies upstream from the downstream node.
It would be more convenient to use different values.

Addresses #66
2019-04-26 16:07:59 -04:00
Michael Klishin 5e3affdcec CLI commands: provide more information to the new help command 2019-03-26 19:50:16 +03:00
Spring Operator ef766e32f0 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated:
   ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException).
* http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException).
* http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException).
* http://e2project.org (200) with 1 occurrences could not be migrated:
   ([https](https://e2project.org) result AnnotatedConnectException).
* http://erlang.2086793.n4.nabble.com/initializing-library-applications-without-processes-td2094473.html (200) with 1 occurrences could not be migrated:
   ([https](https://erlang.2086793.n4.nabble.com/initializing-library-applications-without-processes-td2094473.html) result SSLHandshakeException).
* http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://nitrogenproject.com/) result ConnectTimeoutException).
* http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated:
   ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException).
* http://yaws.hyber.org (200) with 1 occurrences could not be migrated:
   ([https](https://yaws.hyber.org) result AnnotatedConnectException).
* http://choven.ca (503) with 1 occurrences could not be migrated:
   ([https](https://choven.ca) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://fixprotocol.org/ (301) with 1 occurrences migrated to:
  https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException).
* http://erldb.org (UnknownHostException) with 1 occurrences migrated to:
  https://erldb.org ([https](https://erldb.org) result UnknownHostException).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloudi.org/ with 27 occurrences migrated to:
  https://cloudi.org/ ([https](https://cloudi.org/) result 200).
* http://erlware.org/ with 1 occurrences migrated to:
  https://erlware.org/ ([https](https://erlware.org/) result 200).
* http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to:
  https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200).
* http://ninenines.eu with 6 occurrences migrated to:
  https://ninenines.eu ([https](https://ninenines.eu) result 200).
* http://www.actordb.com/ with 2 occurrences migrated to:
  https://www.actordb.com/ ([https](https://www.actordb.com/) result 200).
* http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to:
  https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200).
* http://www.rabbitmq.com/federation.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/federation.html ([https](https://www.rabbitmq.com/federation.html) result 200).
* http://www.rebar3.org with 1 occurrences migrated to:
  https://www.rebar3.org ([https](https://www.rebar3.org) result 200).
* http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* http://inaka.github.com/apns4erl with 1 occurrences migrated to:
  https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301).
* http://inaka.github.com/edis/ with 1 occurrences migrated to:
  https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301).
* http://lasp-lang.org/ with 1 occurrences migrated to:
  https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301).
* http://saleyn.github.com/erlexec with 1 occurrences migrated to:
  https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301).
* http://www.mozilla.org/MPL/ with 27 occurrences migrated to:
  https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301).
* http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to:
  https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301).
2019-03-20 08:16:24 -05:00
Michael Klishin 5b04047100 Update (c) info 2016-01-01 12:59:17 +03:00
Michael Klishin f45a712649 Merge branch 'rabbitmq_v3_5_3_nowait_patch' of https://github.com/operasoftware/rabbitmq-federation 2015-07-01 16:05:02 +03:00
Marek Wiewiorski db7053e4eb Make no-wait flag on exchange.bind and exchange.unbind configurable 2015-06-22 17:54:16 +02:00
Michael Klishin 631b280fe6 (c) year 2015-05-24 05:13:37 +03:00
Simon MacMullen 8b1d0105eb Update copyright for 2014 2014-03-17 17:25:21 +00:00
Simon MacMullen 341946b8a4 First pass at cycle detection. 2014-01-29 18:02:06 +00:00
Simon MacMullen 28c719d91c Found some uses of the old "Connection" nomenclature hiding. 2013-10-08 09:55:26 +01:00
Simon MacMullen 3b1f442036 Some optimisations: Precalculate the table representation of an upstream, and the safe form of a URI, rather than on every delivery. And only call amqp_channel:next_publish_seqno/1 if we are going to use the result. 2013-10-03 17:05:10 +01:00
Simon MacMullen ec17942ffc Merge default 2013-08-16 11:16:54 +01:00
Simon MacMullen ce515d3310 s/VMware/GoPivotal/g 2013-07-01 10:49:12 +01:00
Simon MacMullen 844ff645b6 Allow specifying a different queue name for the upstream, remove use of a fake exchange, start to write tests, remember to sepcify drain. 2013-06-04 15:46:43 +01:00
Simon MacMullen 10ee725db9 Merge default in. 2013-02-05 12:25:13 +00:00
Simon MacMullen 25dbc11929 Rather fiddly refactoring to split up #upstream into #upstream{} and #upstream_params{} - the latter being instantiated by the link process, and representing a choice having been made amongst the URIs in the #upstream{}. So we now should fail over randomly to a new upstream from the set. 2013-02-04 17:11:39 +00:00
Simon MacMullen 3453e5d931 ack-mode 2013-02-01 14:30:31 +00:00
Emile Joubert 5bd7b6461e Update copyright 2013 2013-01-23 11:43:00 +00:00
Simon MacMullen 568e6b86e9 Sketch of a more sophisticated approach to bindings. 2012-10-11 16:23:51 +01:00
Simon MacMullen e2bc04709c Add trust-user-id field to upstreams, and test it. 2012-09-07 13:14:35 +01:00
Simon MacMullen da7663b62b Rename "federation connection" to "upstream", underscores to hyphens in everything parameter-related. 2012-07-04 12:57:48 +01:00
Simon MacMullen cb01d94ef1 Merge default 2012-05-11 16:51:13 +01:00
Simon MacMullen b946c84457 Enforce prefetch, since lacking it can give horrible results. 2012-05-01 18:17:08 +01:00
Simon MacMullen 6ed49a173d Support direct connections. 2012-04-24 13:58:18 +01:00
Simon MacMullen 8debf06129 Merge in default 2012-03-23 13:45:27 +00:00
Simon MacMullen 1fc2209bbb WIP commit on upstream helper exchange. Doesn't pass tests, doesn't have backward compatibility. 2012-03-09 14:36:46 +00:00
Simon MacMullen 2e7f278554 Merge in default 2012-02-29 16:26:17 +00:00
Simon MacMullen 10aad081c1 Control x-ha-policy. 2012-02-29 16:07:47 +00:00
Emile Joubert 6d297855d5 Update copyright 2012 2012-02-02 14:07:58 +00:00
Simon MacMullen a55ab06241 The status database should not be under a mirrored supervsior, we want one per node. So add another supervisor to handle that. 2011-11-17 15:55:23 +00:00
Simon MacMullen 02c363c978 Revert 8117d7737c2c 2011-07-06 13:54:48 +01:00
Simon MacMullen fad71498e5 Don't leak. 2011-07-05 12:11:27 +01:00
Simon MacMullen e70e54fddf Identify upstream by (Connection name, Exchange name). 2011-07-05 11:26:29 +01:00
Simon MacMullen bda7f423a8 Simplistic max_hops. Needs testing. 2011-06-16 15:44:34 +01:00
Simon MacMullen b9ba315033 Rename queue_expires to expires, add support for message-ttl. 2011-06-06 12:17:12 +01:00