amqp / rhea

A reactive messaging library based on the AMQP protocol
Apache License 2.0
273 stars 80 forks source link

Receiver (Consumer) does not receive message that are larger than ~4.15kb #391

Open furious-pineapple opened 1 year ago

furious-pineapple commented 1 year ago

I've noticed that our consumer/receiver does not process messages that are greater than 4.15kb. This consistently happens, as I'm able to remove 5-7 characters and the consumer is able to process messages again. Messages can be published with no issues, but this issue seems to only impact the consumer/receiver.

I've worked with the team that manages the ActiveMQ broker and they've confirmed that the messages that are larger than 4.15kb are in UMB. They also say the message was delivered to the consumer but never processed. From our apps perspective, nothing was ever received because the message event listener never triggered.

I'm hoping that this is just some configuration issue and can be easily resolved.

Versions

rhea: 3.01 Node: 14.15.1

Receiver Configuration

{
    credit_window: 5,
    autoaccept: false,
}

Connection Configuration

{
  host: process.env.UMB_BROKER_HOST ,
  port: Number(process.env.UMB_BROKER_PORT) ,
  transport: 'tls',
  cert: fs.readFileSync(process.env.UMB_CLIENT_CERT)?.toString(),
  key: fs.readFileSync(process.env.UMB_CLIENT_CERT_KEY)?.toString(),
  ca: fs.readFileSync(process.env.UMB_CA_CERT)?.toString(),
  reconnect_limit:  Number(process.env.UMB_MAX_RECONNECT_ATTEMPTS) 
  max_reconnect_delay: Number(process.env.UMB_MAX_RECONNECT_DELAY),
  non_fatal_errors: ['amqp:connection:forced', 'amqp:resource-limit-exceeded'], 
  all_errors_non_fatal: true,
}
grs commented 1 year ago

Rhea certainly handles messages much larger than that and no special configuration should be necessary. I don;t know what UMB is though.

I would get a protocol trace either client or broker side (or using wireshark) and see what that shows. (For rhea you can get a trace by setting env var DEBUG=rhea*)

furious-pineapple commented 1 year ago

When I had debug enabled for rhea, I didn't see any indication that the app ever received the larger message. What really strange about this issue is that the broker believes it delivered the message and the consumer and will reduce our credit window.

I'm very confused because as of right now it looks like our messages ( that are larger than ~4.15kb) are in limbo... outside of our consumer but not within the broker itself. Nothing from our consumer side indicates that we received the message and everything from the brokers perspective makes it seem like the message was delivered.

I'll keep debugging and try different things.

grs commented 1 year ago

Can you get a broker side protocol trace? Env var PN_TRACE_FRM=1 should do it if I recall correctly.