anaray
anaray

Reputation: 359

How to handle error - SRMSG00034: Insufficient downstream requests to emit item

I am load testing a simple application developed in Quarkus. The application proxies http request to another http service. The application uses org.eclipse.microprofile.reactive.messaging.Emitter and org.eclipse.microprofile.reactive.messaging.Channel.

I am getting below error if I push the request rate to 300 req/sec. I am trying to understand error SRMSG00034: Insufficient downstream requests to emit item and how to solve it. Any help would be appreciated.

2021-03-10 06:43:47,678 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-100) HTTP Request to /events failed, error id: cb6577a7-0cd6-4790-a5ea-5ccd73a088fc-289: java.lang.IllegalStateException: SRMSG00034: Insufficient downstream requests to emit item
    at io.smallrye.reactive.messaging.extension.ThrowingEmitter.emit(ThrowingEmitter.java:60)
    at io.smallrye.reactive.messaging.extension.AbstractEmitter.emit(AbstractEmitter.java:146)
    at io.smallrye.reactive.messaging.extension.EmitterImpl.send(EmitterImpl.java:29)

Upvotes: 9

Views: 4615

Answers (1)

Clement
Clement

Reputation: 3202

So, you are using an emitter to push messages somewhere. An emitter is an async structure that has a default buffer to handle slow consumption (see https://quarkus.io/blog/reactive-messaging-emitter/). In your case, the somewhere is not fast enough or the buffer is not large enough.

There are several approaches to work around the issue:

  1. you can change the overflow strategy on the emitter itself, for example, extending the buffer, even use an unbounded buffer if it's safe in your case
  2. you check why the consumption is limited to 300 messages/sec which is rather low

Upvotes: 11

Related Questions