Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/input-rabbitmq.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
| <<plugins-{type}s-{plugin}-key>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-metadata_enabled>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-passive>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-max_inbound_message_body_size>> | <<number,number>> | No
| <<plugins-{type}s-{plugin}-password>> |<<password,password>>|No
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-prefetch_count>> |<<number,number>>|No
Expand Down Expand Up @@ -259,6 +260,16 @@ This is only relevant for direct or topic exchanges.
* Routing keys are ignored on fanout exchanges.
* Wildcards are not valid on direct exchanges.

[id="plugins-{type}s-{plugin}-max_inbound_message_body_size"]
===== `max_inbound_message_body_size`

* Value type: <<number,number>>
* Required: No
* Default: Java client default

Sets the maximum inbound message body size (in bytes) accepted by the RabbitMQ Java client.
If not configured, the Java client's built-in default is used.

[id="plugins-{type}s-{plugin}-metadata_enabled"]
===== `metadata_enabled`

Expand Down
4 changes: 4 additions & 0 deletions lib/logstash/plugin_mixins/rabbitmq_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def setup_rabbitmq_connection_config
# Passive queue creation? Useful for checking queue existance without modifying server state
config :passive, :validate => :boolean, :default => false

# Max inbound message size (in bytes). Optional.
config :max_inbound_message_body_size, :validate => :number

# Extra queue arguments as an array.
# To make a RabbitMQ queue mirrored, use: `{"x-ha-policy" => "all"}`
config :arguments, :validate => :array, :default => {}
Expand Down Expand Up @@ -104,6 +107,7 @@ def rabbitmq_settings

s[:connection_timeout] = @connection_timeout || 0
s[:requested_heartbeat] = @heartbeat || 0
s[:max_inbound_message_body_size] = @max_inbound_message_body_size if @max_inbound_message_body_size

if @ssl
s[:tls] = @ssl_version
Expand Down
10 changes: 10 additions & 0 deletions spec/plugin_mixins/rabbitmq_connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def register
expect(instance.rabbitmq_settings[:tls_certificate_password]).to eql(rabbitmq_settings["ssl_certificate_password"])
end

it "sets max_inbound_message_body_size when configured" do
instance_with_size = klass.new(rabbitmq_settings.merge("max_inbound_message_body_size" => 104857600))
expect(instance_with_size.rabbitmq_settings[:max_inbound_message_body_size]).to eql(104857600)
end

it "does not set max_inbound_message_body_size when not configured" do
expect(instance.rabbitmq_settings.key?(:max_inbound_message_body_size)).to be(false)
end


it_behaves_like 'it sets the addresses correctly'

context 'with a custom port' do
Expand Down