Skip to content
Merged
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
10 changes: 9 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@ ch = connection.create_channel.configure do |new_ch|
end
```

### Support for Setting Maximum Inbound Message Size

A new configuration option, `:max_inbound_message_body_size`, sets the maximum inbound message size limit on the Java client's `ConnectionFactory`.

Contributed by @robbavey.

GitHub issue: [#164](https://github.com/ruby-amqp/march_hare/pull/164).


### RabbitMQ Java Client Upgrade

RabbitMQ Java client dependency has been updated to a `5.25.x` release.


## Changes Between 4.5.0 and 4.6.0 (Nov 10, 2023)

### RabbitMQ Java Client Upgrade
Expand Down
3 changes: 3 additions & 0 deletions lib/march_hare/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Session
# @option options [Logger] :logger The logger. If missing, one is created using :log_file and :log_level.
# @option options [IO, String] :log_file The file or path to use when creating a logger. Defaults to STDOUT.
# @option options [Integer] :log_level The log level to use when creating a logger. Defaults to LOGGER::WARN
# @option options [Integer] :max_inbound_message_body_size Maximum allowed size of an incoming message body. Defaults to 64MiB
#
# @see http://rubymarchhare.info/articles/connecting.html Connecting to RabbitMQ guide
def self.connect(options = {})
Expand All @@ -83,6 +84,8 @@ def self.connect(options = {})

cf.thread_factory = thread_factory_from(options) if include_thread_factory?(options)

cf.max_inbound_message_body_size = options[:max_inbound_message_body_size].to_i if options[:max_inbound_message_body_size]

tls = (options[:ssl] || options[:tls])
case tls
when true then
Expand Down
7 changes: 7 additions & 0 deletions spec/higher_level_api/integration/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ def newThread(runnable)
c.close
end

it "lets you specify a maximum inbound message size" do
c = MarchHare.connect(max_inbound_message_body_size: 64000)
expect(c).to be_connected
c.close
end


it "lets you specify exception handler" do
class ExceptionHandler < com.rabbitmq.client.impl.DefaultExceptionHandler
include com.rabbitmq.client.ExceptionHandler
Expand Down