-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Control Blocking max-concurrency on mutiny requests level
Adds maxConcurrency parameter to Blocking annotation Deprecates smallrye.messaging.worker.pool-name.max-concurrency config option and replaces it with smallrye.messaging.worker.pool-name.pool-size
- Loading branch information
1 parent
86ff386
commit a7d89bc
Showing
12 changed files
with
133 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...ava/io/smallrye/reactive/messaging/blocking/beans/IncomingMaxConcurrencyBlockingBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.smallrye.reactive.messaging.blocking.beans; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CopyOnWriteArrayList; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
import org.eclipse.microprofile.reactive.messaging.Incoming; | ||
|
||
import io.smallrye.reactive.messaging.annotations.Blocking; | ||
|
||
@ApplicationScoped | ||
public class IncomingMaxConcurrencyBlockingBean { | ||
private List<String> list = new CopyOnWriteArrayList<>(); | ||
private List<String> threads = new CopyOnWriteArrayList<>(); | ||
|
||
@Incoming("in") | ||
@Blocking(maxConcurrency = 100) | ||
public void consume(String s) { | ||
if (s.equals("b") || s.equals("d") || s.equals("f")) { | ||
try { | ||
Thread.sleep(100); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
threads.add(Thread.currentThread().getName()); | ||
list.add(s); | ||
} | ||
|
||
public List<String> list() { | ||
return list; | ||
} | ||
|
||
public List<String> threads() { | ||
return threads; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
smallrye-reactive-messaging-provider/src/test/resources/config/worker-config.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
smallrye.messaging.worker.my-pool.max-concurrency=2 | ||
smallrye.messaging.worker.my-pool.pool-size=2 | ||
smallrye.messaging.worker.another-pool.max-concurrency=5 |