Commit Graph

42 Commits

Author SHA1 Message Date
David Ansari de804d1fa7 Support publishing AMQP 1.0 to Event Exchange
## What?

Prior to this commit, the `rabbitmq_event_exchange` internally published
always AMQP 0.9.1 messages to the `amq.rabbitmq.event` topic exchange.
This commit allows users to configure the plugin to publish AMQP 1.0
messages instead.

 ## Why?

Prior to this commit, when an AMQP 1.0 client consumed events,
event properties that are lists were omitted. For example property
`client_properties` of event `connection.created` or property
`arguments` of event `queue.created` were omitted because of the following sequence:
1. The event exchange plugins listens for all kind of internal events.
2. The event exchange plugin re-publishes all events as AMQP 0.9.1 message to the event exchange.
3. Later, when an AMQP 1.0 client consumes this message, the broker must translate the message from AMQP 0.9.1 to AMQP 1.0.
4. This translation follows the rules outlined in https://www.rabbitmq.com/docs/conversions#amqpl-amqp
5. Specifically, in this table the row before the last one describes the rule we're hitting here. It says that if the AMQP 0.9.1
header value is not an `x-` prefixed header and its value is an array or table, then this header is not converted.
That's because AMQP 1.0 application-properties must be simple types as mandated in https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-application-properties

 ## How?

The user can configure the plugin as follows to have the plugin
internally publish AMQP 1.0 messages:
```
event_exchange.protocol = amqp_1_0
```

To support complex types such as lists, the plugin sets all event
properties as AMQP 1.0 message-annotations. The plugin prefixes all message
annotation keys with `x-opt-` to comply with the AMQP 1.0 spec.

 ## Alternative Design

An alternative design would have been to format all event properties
e.g. as JSON within the message body. However, this breaks routing on
specific event property values via a headers exchange.

 ## Documentation
https://github.com/rabbitmq/rabbitmq-website/pull/2129
2024-11-14 12:52:09 +01:00
David Ansari f55cd21e52 Add AMQP 1.0 event exchange test 2024-10-29 12:04:09 +01:00
Michael Davis d98e0f2dd2
rabbitmq_event_exchange: Test for parameters in exchange deletion
With the change in the parent commit we no longer set and clear a
runtime parameter when deleting an exchange as part of vhost deletion.
We need to adapt the `audit_vhost_internal_parameter` test case to test
that the parameter is set and cleared when the exchange is deleted
instead.
2024-09-05 11:42:13 -04:00
Michael Klishin fb775afcc8
More (c) source header updates #9969 2024-01-19 19:53:28 -05:00
Michael Klishin 01092ff31f
(c) year bumps 2024-01-01 22:02:20 -05:00
Michael Klishin 1b642353ca
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2023-11-21 23:18:22 -05:00
Jean-Sébastien Pédron 0354bdcd7f
rabbitmq_event_exchange: Use a non-deprecated policy in system_SUITE 2023-09-04 21:09:11 +02: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
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
dcorbacho 7d029dd5ea Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-12 22:47:07 +01:00
Jean-Sébastien Pédron 2bf9994e5e Update copyright (year 2020) 2020-03-10 16:09:41 +01:00
Michael Klishin 62761c8234 (c) bump 2019-12-29 05:50:28 +03:00
Spring Operator cb00b95fef 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://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://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to:
  https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 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/community-plugins.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/community-plugins.html ([https](https://www.rabbitmq.com/community-plugins.html) result 200).
* http://www.rabbitmq.com/plugin-development.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/plugin-development.html ([https](https://www.rabbitmq.com/plugin-development.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 6 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 03:15:07 -05:00
Michael Klishin 34ad97c117 Default exchange bindings are implicit as of rabbitmq/rabbitmq-server#1721 2019-01-10 05:16:56 +03:00
Diana Corbacho 26066623ce Update test cases
[#160943793]
2018-10-19 11:15:30 +02:00
Diana Corbacho 816627821b Use eunit macros for assertions 2018-08-20 15:04:30 +01:00
Diana Corbacho e9776239af Delete exchange when unregistering/disabling plugin
[#159848473]
2018-08-20 14:05:21 +01:00
Michael Klishin 4db0006f8f Expose rabbitmq_event_exchange.vhost to new style config
as event_exchange.vhost.

Closes #31.

[#159764208]

(c) year update

Ignore the rabbit.schema file that ct helpers copies over
2018-08-14 08:25:06 -07:00
Michael Klishin 35d051a7a2 Merge branch 'stable' 2017-04-02 21:57:24 +03:00
Michael Klishin 293f318016 (c) year 2017-04-02 21:47:54 +03:00
Jean-Sébastien Pédron 0404362a7b system_SUITE: Remove an unused `Headers` variable to fix a warning 2017-03-06 11:53:51 +01:00
Jean-Sébastien Pédron fa7f1c4a21 system_SUITE: Remove unbound `Ch` variable to fix build
Also, remove an unused `Headers` variable to fix a warning.
2017-03-06 11:53:11 +01:00
Michael Klishin b64d9bd781 Merge branch 'stable'
Conflicts:
	test/system_SUITE.erl
2017-02-23 19:59:50 +03:00
Diana Corbacho 8d15e46589 Test resource alarms 2017-02-22 15:59:14 +00:00
Jean-Sébastien Pédron f68ccaa302 system_SUITE: set_topic_permissions() takes 6 arguments now
References rabbitmq/rabbitmq-server#1085.
2017-02-09 10:38:52 +01:00
Diana Corbacho 80eb4e8c7f Use add_user/5 2017-01-16 10:22:48 +00:00
Diana Corbacho b83f8710f9 Test the user taking action is present in topic.permission.* events 2017-01-16 08:36:41 +00:00
Diana Corbacho dbf314d2d4 Test that the user taking the action is notified in all system events 2017-01-13 14:24:53 +01:00
Jean-Sébastien Pédron 6952b4a906 Merge branch 'stable' 2016-06-16 13:16:43 +02:00
kjnilsson fcccb89824 migrate to common_test
- rename suites
- add travis configuration
2016-06-16 11:12:38 +01:00
Daniil Fedotov 88ff141ea3 Do not use time_compat 2016-05-12 10:27:21 +01:00
Michael Klishin 01055fdacd Delete a binding that's no longer used in this test 2016-03-31 21:26:02 +03:00
Michael Klishin 43e1f20bcc Add a test for the user.authentication.success event
References #13.
2016-03-30 17:01:02 +03:00
Michael Klishin 89b21462b8 Wording 2016-02-04 03:31:52 +03:00
Michael Klishin 3fd9499b5a Per AMQP 0-9-1 spec, timestamps must be in seconds
It really makes little sense for event collection but in this case
we must obey by the specs, as clients expect seconds resolution.

Fixes #8.
2016-02-04 03:29:22 +03:00
Michael Klishin 2640dc92d6 Update (c) info 2016-01-01 12:59:17 +03:00
Michael Klishin 56c3cda88e (c) year 2015-05-24 05:06:31 +03:00
Simon MacMullen 093f297225 Compile on R13B03 2014-06-13 11:50:00 +01:00
Simon MacMullen 00c46c8cc6 Use ~p not ~w to format "weird" terms so that we get sensible formatting of strings embedded within them. 2014-03-21 14:52:46 +00:00
Simon MacMullen bd0c26fb39 Table and array encoding, and some tests. 2014-03-19 12:20:13 +00:00
Simon MacMullen a1f7249dde Even a very simple test is better than none at all. 2014-03-12 11:37:42 +00:00