Skip to content

AMQP connector has no way to adjust initial credits for incoming channel. #3384

@ylepikhov

Description

@ylepikhov

Hi. Vertx AmqpReceiverImpl has default value of 1000 for initial credits. It can be changed via AmqpReceiverOptions.maxBufferedMessages, but smallrye AMQP Connector never use it.

1000 initial credits is too much for slow consumers and large messages.

It will be nice, if AmqpReceiverOptions.maxBufferedMessages could be configured via channel configuration.

It might be something like:

  • smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/AmqpConnector.java:
    @ConnectorAttribute(name = "initial-credits", type = "int", direction = INCOMING, description = "Initial credits for receiver.")
  • smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/IncomingAmqpChannel.java:
        AmqpReceiverOptions options = new AmqpReceiverOptions()
                .setAutoAcknowledgement(ic.getAutoAcknowledgement())
                .setDurable(ic.getDurable())
                .setLinkName(link)
                .setCapabilities(getClientCapabilities(ic))
                .setSelector(ic.getSelector().orElse(null))
                .setMaxBufferedMessages(ic.getInitialCredits().orElse(1000));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions