Skip to main content

AMQP 1.0 in Spring Boot 4.2 with RabbitMQ 4: Three Starters, Real Failures, and the Listener That Kills Its Own Consumer

Spring Boot 4.2 ships three AMQP starters, and spring-boot-starter-amqp now means AMQP 1.0. Verified against a real RabbitMQ 4.4.1: which starter to pick, every way a send fails, and why one exception silently stops an @AmqpListener consumer.

You upgrade to Spring Boot 4.2, leave spring-boot-starter-amqp in your pom.xml, and the application still starts. It just no longer talks to RabbitMQ the way it did yesterday: there is no RabbitTemplate, and the spring.rabbitmq.* properties are not the ones it reads. The starter kept its name and changed its meaning — it now gives you AMQP 1.0, a different protocol from the one RabbitMQ was built around. That is a bigger surprise than it sounds, so this article does three things. It sorts out the three AMQP starters Boot 4.2 now ships and which one you want. It then uses the two AMQP 1.0 ones against a real RabbitMQ 4 broker, including every way a send can fail. And it ends on the finding that cost the most time while writing the companion module: under Boot’s defaults, one exception thrown from an @AmqpListener method permanently stops that consumer, and nothing tells you.
Verified against these versions. Spring Boot 4.2.0 (GA 19 November 2026), Spring Framework 7.1.0, Spring AMQP 4.2.0, Qpid ProtonJ2 client 1.4.0, RabbitMQ AMQP 1.0 Java client 1.7.0, and a real rabbitmq:4-management broker that reported RabbitMQ 4.4.1 on Erlang 29.1.3, started by Testcontainers 2.0.5 on Temurin 25.0.5.1. Every number below comes from a transcript in the companion module, written by a test that asserts the same value.

Boot 4.2 has three AMQP starters, and the old name now means something new

AMQP is a wire protocol: the rules for how a client and a broker talk to each other. RabbitMQ was designed around AMQP 0-9-1, and almost every RabbitMQ tutorial you have read uses it. AMQP 1.0 is a separate, later standard from OASIS. The name is misleading — it is not version 1.0 of the old protocol, it is a different protocol with different concepts (it talks about addresses and links where 0-9-1 talks about exchanges and channels). ActiveMQ, Artemis and Azure Service Bus speak it, and RabbitMQ 4 speaks it natively. Spring Boot 4.2 ships one starter for each situation. I read the descriptions and property prefixes straight out of the three starters’ jars rather than from the documentation:
StarterProtocolClient libraryPropertiesYou get
spring-boot-starter-amqpAMQP 1.0, any brokerQpid ProtonJ2spring.amqp.*AmqpClient, @AmqpListener
spring-boot-starter-amqp-rabbitmqAMQP 1.0, RabbitMQ onlyRabbitMQ AMQP 1.0 clientspring.amqp.rabbitmq.*RabbitAmqpTemplate, RabbitAmqpAdmin, @RabbitListener
spring-boot-starter-rabbitmqAMQP 0-9-1amqp-client 5.xspring.rabbitmq.*RabbitTemplate, @RabbitListener
Three starters, three clients, one broker spring-boot-starter-amqpspring.amqp.* / AmqpClient starter-amqp-rabbitmqspring.amqp.rabbitmq.* / RabbitAmqpTemplate spring-boot-starter-rabbitmqspring.rabbitmq.* / RabbitTemplate Qpid ProtonJ2 clientany AMQP 1.0 broker RabbitMQ AMQP 1.0 clientRabbitMQ only amqp-client 5.xRabbitMQ only, AMQP 0-9-1 RabbitMQ 4.4.1one listener, port 5672speaks 1.0 and 0-9-1 Solid lines are AMQP 1.0, the dashed line is AMQP 0-9-1. The broker does not care which client arrives; your code does, because each starter gives you different beans, properties and annotations.
The diagram is the whole decision. If your code was written against RabbitTemplate and spring.rabbitmq.*, you are on the dashed line and the starter you want is now spring-boot-starter-rabbitmq. If you want to be able to swap the broker, you want the first starter. If you are committed to RabbitMQ but want AMQP 1.0, you want the second. The descriptions below are quoted from the starters’ own POMs and the module’s starter comparison transcript:
== spring-boot-starter-amqp: description and dependencies
<description>Starter for generic AMQP 1.0 support</description>
<artifactId>spring-boot-amqp</artifactId>

== spring-boot-starter-amqp-rabbitmq: description and dependencies
<description>Starter for using Spring AMQP with Rabbit MQ over AMQP 1.0 protocol</description>
<artifactId>spring-boot-amqp-rabbitmq</artifactId>

== spring-boot-starter-rabbitmq: description and dependencies
<description>Starter for using RabbitMQ messaging and streaming broker</description>
The upgrade trap. Nothing fails to compile when a 4.1 project that used spring-boot-starter-amqp for RabbitMQ moves to 4.2 — the dependency still resolves, it just now pulls in a different client. The fix is to rename the dependency to spring-boot-starter-rabbitmq. The Spring Boot 4.2 upgrade checklist lists this among the other 4.1-to-4.2 changes.
The defaults differ too, and one difference matters later in this article: spring.rabbitmq.username and password default to guest, while spring.amqp.username and password default to nothing at all.
Going deeper: the three property sets side by side

The generic starter binds spring.amqp.host (default localhost), port (5672), username, password, plus spring.amqp.client.completion-timeout (60 s), spring.amqp.client.default-to-address (no default), and the listener group spring.amqp.listener.* (concurrency 1, initial credits 100, receive timeout 1 s, graceful shutdown 30 s, auto-startup true). The RabbitMQ AMQP 1.0 starter binds host, port, username, password and address under spring.amqp.rabbitmq.*, with no defaults for username or password. All of it is printed in 10-starter-comparison.txt.

A note on how this module was built: I first hand-wired RabbitMQ’s AMQP 1.0 client with my own @Bean methods, because the two starters I had inspected did not configure it. I then found that the third starter, spring-boot-starter-amqp-rabbitmq, does. The module now uses it, and the transcript in the next-but-one section lists the beans it created.

Start a real RabbitMQ 4 broker — AMQP 1.0 needs no plugin

Everything in this article ran against a real broker, started by Testcontainers from the official rabbitmq:4-management image. The only configuration is a test bean annotated @ServiceConnection; Boot’s AMQP starters ship connection-details factories for RabbitMQ containers, so no spring.amqp.* property is set by hand. The bean lives in TestBrokerConfig.java:
@TestConfiguration(proxyBeanMethods = false)
public class TestBrokerConfig {

    @Bean
    @ServiceConnection
    RabbitMQContainer broker() {
        return Broker.CONTAINER;
    }
}
Then the first thing worth knowing about the broker itself. On RabbitMQ 3.x you had to enable a plugin to speak AMQP 1.0. On 4.4.1 the list of enabled plugins is only the management UI and Prometheus, and AMQP 1.0 connections work anyway (output from 01-broker.txt):
rabbitmq_version = 4.4.1
erlang_version   = 29.1.3
$ rabbitmq-plugins list -E -m
Listing plugins with pattern ".*" ...
rabbitmq_management
rabbitmq_prometheus
listeners:
  amqp on port 5672
  clustering on port 25672
  http on port 15672
  http/prometheus on port 15692
Both protocols share port 5672 — there is no separate AMQP 1.0 listener in that list, which is why one broker can serve all three starters at once.
Going deeper: why the numbers I check lag behind reality

Two things in the test harness are worth copying. First, the management API and rabbitmqctl list_queues both report queue and consumer counts from statistics that are sampled on a timer, so right after a change they show the old value: my first run printed consumers=0 for a queue that was demonstrably delivering messages. The tests therefore poll until the number settles (up to 15 seconds) rather than sleeping a fixed time. Second, the JDK HttpClient defaults to trying HTTP/2 first, and the management port answered that with an EOF; forcing HTTP/1.1 fixed it. Both are in Broker.java.

Send and receive with the generic starter

With spring-boot-starter-amqp on the classpath Boot creates an AmqpClient bean, designed to feel like WebClient or JdbcClient, and a listener container for @AmqpListener methods. A listener names an address, not a queue. RabbitMQ’s address for a queue is /queues/<name>. The generic client has no way to declare anything, so the queue has to exist first; the tests create it over the management API. The receiver is a plain component, in GenericOrderListener.java:
@Component
public class GenericOrderListener {

    private final List<OrderMessage> received = new CopyOnWriteArrayList<>();

    @AmqpListener(id = "generic-orders", addresses = "/queues/orders.generic")
    void onOrder(OrderMessage order) {
        received.add(order);
    }

    public List<OrderMessage> received() {
        return received;
    }
}
Sending is one fluent call that returns a CompletableFuture<Boolean>. The Boolean is the broker’s verdict, not just “the bytes left my machine” — hold that thought for the failure section. The call, from Test02GenericTest.java:
Boolean accepted = amqpClient.to("/queues/orders.generic").body(o).send().get();
Three orders sent, three orders received, and the broker reports one AMQP 1.0 connection ({1, 0} is how rabbitmqctl prints protocol version 1.0). Output from 02-generic-send-receive.txt:
$ AmqpClient.to("/queues/orders.generic").body(order).send()
send o-1 -> accepted=true
send o-2 -> accepted=true
send o-3 -> accepted=true
@AmqpListener received 3: [o-1, o-2, o-3]
queue orders.generic: type=quorum consumers=1 messages=0
$ rabbitmqctl list_connections protocol user
  protocol	user
  {1, 0}	guest
Going deeper: the container, credits and concurrency

The listener container opens one AMQP 1.0 receiver per consumer. Instead of RabbitMQ’s prefetch count, AMQP 1.0 uses link credit: the receiver tells the broker how many messages it is ready to take. Boot exposes it as spring.amqp.listener.initial-credits (default 100). concurrency defaults to 1, so the module’s queue shows consumers=1 above. Both values are printed in the starter comparison transcript; I did not benchmark them.

What the broker really stores — and the pull that eats a message

To see what a message looks like on the broker, the test peeks at a queue through the management API before consuming anything. The JSON converter wrote the body as JSON, set the content type, and added one header: __TypeId__, holding the Java class name. That header is how a receiver later knows what to turn the bytes back into (03-generic-pull-and-peek.txt):
what the broker holds (management API, 0-9-1 view of an AMQP 1.0 message):
  payload      = {"id":"p-1","item":"mouse","qty":3}
  content_type = application/json
  headers      = {"__TypeId__":"com.ankurm.amqp10.OrderMessage"}
The listener in the previous section never had a problem with this, because it declares its parameter type. Pulling a message on demand is different. receiveAndConvert() takes no argument, and if you let the result be an Object, the converter falls back to the __TypeId__ header — and refuses, because by default it only trusts classes from java.util and java.lang. The worse part is the order of events: the message is taken off the queue first and converted second. From Test02GenericTest.java, the typed form of the pull (the transcript below it comes from the same file as above: two messages in the queue, one failed untyped pull, one good typed pull):
java.util.concurrent.CompletableFuture<OrderMessage> typed =
        amqpClient.from("/queues/orders.pull").timeout(Duration.ofSeconds(5)).receiveAndConvert();
depth before pulling = 2
$ untyped:  Object o = from("/queues/orders.pull").receiveAndConvert().get()
  -> java.lang.IllegalArgumentException: The class 'com.ankurm.amqp10.OrderMessage' is not in the trusted packages: [java.util, jav...
depth after the failed conversion = 1
$ typed:    CompletableFuture<OrderMessage> f = from(...).receiveAndConvert()
  -> OrderMessage[id=p-2, item=dock, qty=1]
depth after the typed pull = 0
A failed pull is a lost message. Depth went from 2 to 1 on the failed call, and the typed pull then returned p-2: p-1 was gone. The fix is to give the call a target type — assign the result to a CompletableFuture<OrderMessage>, as above — or to configure your own JacksonJsonMessageConverter with the package trusted. Listeners are not affected, because their parameter type already says what to convert to.
Going deeper: why the assigned type matters

I confirmed the behaviour by running both forms (the transcript above). I did not trace the client’s internals, so I cannot say why the message is already gone when conversion fails; I can only report that the depth dropped.

When a send goes wrong: ACCEPTED, RELEASED and REJECTED

Every AMQP 1.0 send ends with the broker telling the sender what it did with the message. That is the Boolean from the future above: true means accepted. Anything else becomes an AmqpClientNackReceivedException naming the outcome. I sent to five addresses; the loop is in Test04AddressFailuresTest.java:
String[] addresses = { "/queues/orders.generic", "/queues/does.not.exist", "orders.generic",
        "/queue/orders.generic", "/exchanges/amq.direct/nobody-listens" };
for (String a : addresses) {
    String r = send(a);
    t.line("to(\"%s\")", a);
    t.line("  %s", r);
}
// The one good address must still work, and the bad ones must not have created anything.
What the sender hears back ACCEPTED (true)/queues/orders.generic address valid, queue exists,message is now in the queue RELEASED/queues/does.not.exist/exchanges/amq.direct/key address is well-formed, butthere is nowhere to put it REJECTEDorders.generic/queue/orders.generic the broker did not accept theaddress string itself Only the first outcome means the message exists. The other two arrive as AmqpClientNackReceivedException, so a send you never check is a message you may have lost.
The diagram sorts the five real results (04-address-failures.txt) into the three outcomes. Read them as a rule of thumb: released means the address was understood but nothing could take the message — a queue that does not exist, an exchange with no matching binding. Rejected means the broker did not accept the address string itself: a bare queue name without /queues/, or the singular /queue/ that looks right and is not.
to("/queues/orders.generic")
  returned true after 13 ms
to("/queues/does.not.exist")
  threw AmqpClientNackReceivedException: The message was not accepted, but RELEASED after 5 ms
to("orders.generic")
  threw AmqpClientNackReceivedException: The message was not accepted, but REJECTED after 5 ms
to("/queue/orders.generic")
  threw AmqpClientNackReceivedException: The message was not accepted, but REJECTED after 2 ms
to("/exchanges/amq.direct/nobody-listens")
  threw AmqpClientNackReceivedException: The message was not accepted, but RELEASED after 2 ms
A connection that cannot be made is a different failure, and a kinder one: the application refuses to start. Test05CredentialsTest.java starts the real application four times with different connection settings (transcript):
no spring.amqp.username / password set:
  context started = true
  send -> true (context up in 953 ms); broker sees: {1, 0}	guest
username=guest password=wrong:
  context started = false
  javax.security.sasl.AuthenticationException: SASL exchange failed to authenticate client (3271 ms)
username=guest password=guest:
  context started = true
  send -> true (context up in 988 ms); broker sees: {1, 0}	guest
port=1 (nothing listens):
  context started = false
  java.net.ConnectException: finishConnect(..) failed with error(-111): Connection refused (202 ms)
No credentials still logged in — as guest. With spring.amqp.username and password unset (their default), the broker saw a connection from user guest, and the send succeeded. I saw it, but I did not trace which authentication mechanism the client and broker agreed on. The practical reading: an application with a forgotten credentials property does not fail at start-up here, it quietly connects as the default user, so set the properties explicitly and do not rely on a failure to notice a missing one.
Going deeper: what the outcomes are in the standard

Accepted, rejected and released are three of the delivery outcomes defined by the AMQP 1.0 specification (there is also a fourth, modified). What I measured is how Spring’s client and RabbitMQ 4.4.1 map real mistakes onto them, which the specification does not dictate. Treat the table above as observed behaviour of this combination of versions.

RabbitMQ’s own client: topology, confirmed publishing and @RabbitListener

The second AMQP 1.0 starter is for people who have decided on RabbitMQ and want its client’s extra abilities, most visibly declaring queues, exchanges and bindings — the thing the generic client cannot do. Everything it needs is auto-configured: the test lists the beans it found, and none of them has a @Bean method in the module (06-rabbit-client.txt):
beans from spring-boot-starter-amqp-rabbitmq (no @Bean written for them):
  RabbitAmqpTemplate           [rabbitAmqpTemplate]
  RabbitAmqpAdmin              [rabbitAmqpAdmin]
  RabbitAmqpListenerContainerFactory [rabbitListenerContainerFactory]
  AmqpConnectionFactory        [amqpRabbitConnectionFactory]
What is left for you to write is the topology and the listener. A Declarables bean describes a quorum queue, a topic exchange and the binding between them, and RabbitAmqpAdmin declares them when the context starts. The listener uses @RabbitListener — the same annotation as the classic starter, a detail to keep in mind when both could be on a classpath. The file is RabbitSpecificConfig.java:
Declarables rabbitTopology() {
    Queue queue = QueueBuilder.durable(QUEUE).quorum().build();
    TopicExchange exchange = new TopicExchange(EXCHANGE);
    Binding binding = BindingBuilder.bind(queue).to(exchange).with(ROUTING_KEY);
    return new Declarables(queue, exchange, binding);
}
@RabbitListener(queues = QUEUE)
void onOrder(OrderMessage order) {
    received.add(order);
}
Publishing goes through an exchange and a routing key, and the returned future completes with the broker’s confirmation. The test publishes once, then tries two destinations that cannot work (Test06RabbitClientTest.java):
Boolean confirmed = template.convertAndSend(RabbitSpecificConfig.EXCHANGE,
        RabbitSpecificConfig.ROUTING_KEY, order).get(10, TimeUnit.SECONDS);
declared by RabbitAmqpAdmin:
  queue    orders.rabbit type=quorum durable=true
  exchange orders.topic type=topic
  binding  orders.topic -> orders.rabbit key=orders.created
$ template.convertAndSend("orders.topic", "orders.created", order).get() -> true
@RabbitListener(queues = "orders.rabbit") received OrderMessage[id=r-1, item=router, qty=2]
unroutable key  : threw AmqpNackReceivedException: The message was rejected after 4 ms
missing exchange: threw AmqpMessageRejectedException: no exchange 'no.such.exchange' in vhost '/' after 2 ms
Compare the failures with the generic client’s. Here a missing exchange arrives as an exception that names the exchange and the virtual host (no exchange 'no.such.exchange' in vhost '/'), where the generic client could only say RELEASED. If good error messages matter to you, that is a real argument for the RabbitMQ-specific starter.
Going deeper: what spring.amqp.rabbitmq.* adds

The properties the transcript read from the jar are address, host (default localhost), port, username and password (no defaults for the last three). I only exercised host, port and credentials, through @ServiceConnection. TLS, OAuth2 and anything else in that namespace were not run.

One queue, two protocols: moving over without a big bang

A queue in RabbitMQ does not belong to a protocol. A producer on AMQP 0-9-1 and a consumer on AMQP 1.0 can share it, which is what makes a gradual migration possible: move consumers first, producers later, or the reverse. Test07InteropTest.java does it both ways with a classic RabbitTemplate and the generic AmqpClient:
One queue, two protocols RabbitTemplate (0-9-1) AmqpClient (1.0) queueorders.interop AmqpClient.receive (1.0) RabbitTemplate.receive Top row: written over 0-9-1, read over 1.0. Bottom row: the reverse. The queue itself has no protocol.
classic.send("", "orders.interop", out);
amqpClient.to("/queues/orders.interop").body(new OrderMessage("i-2", "amqp10", 2))
        .messageId("m-amqp10").correlationId("c-amqp10").header("tenant", "acme").header("attempt", 3)
        .durable(true).creationTime(new Date()).send().get();
Message id, correlation id, content type and custom headers all survive in both directions, and both protocols are connected at the same moment (07-classic-interop.txt):
0-9-1 producer (RabbitTemplate) -> AMQP 1.0 consumer (AmqpClient.receive):
  body           = {"id":"i-1","item":"classic","qty":1}
  messageId      = m-classic
  correlationId  = c-classic
  contentType    = application/json
  deliveryMode   = null
  headers        = {attempt=3, tenant=acme}
AMQP 1.0 producer (AmqpClient.to) -> 0-9-1 consumer (RabbitTemplate.receive):
  body           = {"id":"i-2","item":"amqp10","qty":2}
  messageId      = m-amqp10
  correlationId  = c-amqp10
  contentType    = application/json
  deliveryMode   = PERSISTENT
  headers        = {__TypeId__=com.ankurm.amqp10.OrderMessage, attempt=3, tenant=acme}
$ rabbitmqctl list_connections protocol, while both clients are connected:
  AMQP 0-9-1 connection open = true, AMQP 1.0 connection open = true
One field did not travel. The message the 0-9-1 producer marked PERSISTENT showed deliveryMode = null when received over AMQP 1.0, while the message sent over 1.0 with durable(true) arrived as PERSISTENT on 0-9-1. I did not look into why. Until you have, do not branch on the delivery mode of a message you consumed over 1.0.
Going deeper: a migration order I would try

This is my reading of the evidence above, not something I ran as a migration. Because the broker accepts both at once, the lower-risk order is probably: first add the new consumer on AMQP 1.0 with an ErrorHandler (see the next section), let the old producers keep publishing over 0-9-1, check the headers you depend on arrive intact, and only then move the producers. The one concrete trap measured here is __TypeId__: a message sent over 1.0 by Spring’s JSON converter carries it, so a classic consumer reading it must trust the same package.

The listener that kills its own consumer

A consumer is the thread that takes messages from a queue and hands them to your method. Normally an exception in your method means “this message failed”: the container logs it, decides what to do with the message, and keeps going. The module has three listeners that always throw, to see what Boot 4.2.0’s defaults do. They live in PoisonListeners.java:
@AmqpListener(id = "poison-plain", addresses = "/queues/orders.poison.plain")
void plain(OrderMessage order) {
    plainAttempts.incrementAndGet();
    throw new IllegalStateException("cannot process " + order.id());
}
@AmqpListener(id = "poison-reject", addresses = "/queues/orders.poison.reject")
void reject(OrderMessage order) {
    rejectAttempts.incrementAndGet();
    throw new AmqpRejectAndDontRequeueException("cannot process " + order.id());
}
One bad message goes to each queue, then a perfectly good one goes to the first queue afterwards. Results from 08-poison-default.txt:
container errorHandler (Boot's default factory) = null
one bad message sent to each queue, listener always throws:
listener                               attempts  consumers messages left in queue
plain exception, autoAccept default    1         0         1  (the bad message was lost; the follow-up is waiting)
AmqpRejectAndDontRequeueException      1         0         0
plain exception, autoAccept=false      1         0         1  (released back, but nobody is left to take it)
follow-up message good-1 delivered to the plain listener? attempts still = 1
Boot 4.2.0 default: one exception ends the consumer delivery arrives listener throws errorHandler?null in Boot’s factory rethrow threadends consumers = 0 attempts = 1 the next message waits in the queue, unread nothing restarts the consumer, and the application stays up With an ErrorHandler on the container, the same exception is logged and the loop carries on.
Read the table as the diagram does. Every listener was called exactly once, and then the number of consumers on the queue became 0. The good message sent afterwards sits in the queue, never delivered. In the first row the bad message is also gone — it was accepted before the method ran. In the third row, with autoAccept = "false", it was released back to the queue, which sounds better until you notice nobody is left to take it. What the evidence shows: the first line of the transcript is the container’s errorHandler, read by reflection, and under Boot’s own factory it is null. With no handler, one thrown exception ends the consumer (the diagram is my reading of that, not a trace of the container’s code). The fix is a container-level ErrorHandler. Boot builds its factory for you, so you have to replace it, in HandledFactoryConfig.java:
MethodAmqpMessageListenerContainerFactory amqpListenerContainerFactory(
        AmqpMessageListenerContainerFactoryConfigurer configurer, AmqpConnectionFactory connectionFactory) {
    MethodAmqpMessageListenerContainerFactory factory = new MethodAmqpMessageListenerContainerFactory(connectionFactory);
    configurer.configure(factory); // keep every spring.amqp.listener.* property Boot would have applied
    factory.setErrorHandler(t -> LOG.warn("listener failed, consumer stays alive: " + t.getMessage()));
    return factory;
}
Same three listeners, same bad messages, with that factory active (09-poison-with-error-handler.txt):
container errorHandler = set (lambda)
with a container ErrorHandler (HandledFactoryConfig), one bad message per queue:
plain exception, autoAccept default : 1 attempt(s); follow-up good-1 reached the listener = true
AmqpRejectAndDontRequeueException   : 1 attempt(s)
plain exception, autoAccept=false   : 1877 attempts in 3 seconds (figure varies per run, still counting)
queue orders.poison.manual depth now : 2
Two traps in the fix. First, name the bean amqpListenerContainerFactory. Boot’s own bean has that name, although the Java method that declares it is called amqpMessageListenerContainerFactory. My first attempt used the method name, which silently produced a second factory that no listener used; the container I inspected still had errorHandler = null. Second, with an error handler and autoAccept = "false" a failing message is released and redelivered immediately, with no delay and no limit — about two thousand attempts in three seconds in this run (the figure varies per run). That is a hot loop. An error handler keeps the consumer alive; it does not decide what happens to the message.
Going deeper: how I found it

The first symptom was only that a second listener test never saw its message. The broker numbers settled the question: after the failure, consumers for the queue dropped to 0 (I waited for the sampled statistic rather than trusting the first read) while messages_ready held the follow-up. Reading the container’s errorHandler field showed null, and setting it was the only change between the two transcripts.

The documented property spring.amqp.listener.default-requeue-rejected defaults to true. I did not find that it changed any of the outcomes above and did not trace why; I am reporting the measured behaviour, not a theory.

Should you move to AMQP 1.0 at all?

Not automatically. The classic 0-9-1 starter describes itself in its POM as a starter for the “RabbitMQ messaging and streaming broker”; I did not run Streams, and nothing in this module argues against it. Choose by what you need: spring-boot-starter-rabbitmq if you are happy and want the broadest RabbitMQ feature set; spring-boot-starter-amqp-rabbitmq if you are RabbitMQ-only but want AMQP 1.0; spring-boot-starter-amqp if portability across AMQP 1.0 brokers is the point.

If you take the generic one, do not ship an @AmqpListener without a container ErrorHandler, check the result of every send, and set credentials explicitly. Not tested here: TLS, clustering and failover, throughput, Streams, OAuth2, and the batch listener.

Further reading

No Comments yet!

This site uses Akismet to reduce spam. Learn how your comment data is processed.