Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing threadPoolSize param in TransactionalOutboxBuilder.build #29

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Transactional Outbox is published on `mavenCentral`. In order to use it just add

```gradle
implementation("io.github.bluegroundltd:transactional-outbox-core:2.0.3")
implementation("io.github.bluegroundltd:transactional-outbox-core:2.0.4")
```

Expand Down
2 changes: 1 addition & 1 deletion core/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GROUP=io.github.bluegroundltd
POM_ARTIFACT_ID=transactional-outbox-core
VERSION_NAME=2.0.3
VERSION_NAME=2.0.4

POM_NAME=Transactional Outbox Core
POM_DESCRIPTION=Easily implement the transactional outbox pattern in your JVM application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import io.github.bluegroundltd.outbox.item.factory.OutboxItemFactory
import io.github.bluegroundltd.outbox.store.OutboxStore
import java.time.Clock
import java.time.Duration
import kotlin.properties.Delegates

/**
* Builder for [TransactionalOutbox].
Expand Down Expand Up @@ -36,7 +35,7 @@ class TransactionalOutboxBuilder(
InstantOutboxPublisherStep,
BuildStep {
private val handlers: MutableMap<OutboxType, OutboxHandler> = mutableMapOf()
private var threadPoolSize by Delegates.notNull<Int>()
private var threadPoolSize: Int? = null
private var threadPoolTimeOut: Duration = DEFAULT_THREAD_POOL_TIMEOUT
private var decorators: MutableList<OutboxItemProcessorDecorator> = mutableListOf()
private lateinit var monitorLocksProvider: OutboxLocksProvider
Expand Down Expand Up @@ -157,7 +156,7 @@ class TransactionalOutboxBuilder(
* Builds the outbox.
*/
override fun build(): TransactionalOutbox {
val executorServiceFactory = FixedThreadPoolExecutorServiceFactory()
val executorServiceFactory = FixedThreadPoolExecutorServiceFactory(threadPoolSize)
val outboxItemFactory = OutboxItemFactory(clock, handlers.toMap(), rerunAfterDuration)

return TransactionalOutboxImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import java.util.concurrent.Executors
* Creates a fixed thread pool executor service, using a default pool size and name format for threads.
*/
internal class FixedThreadPoolExecutorServiceFactory(
private val threadPoolSize: Int = DEFAULT_THREAD_POOL_SIZE,
threadPoolSize: Int? = null,
private val threadNameFormat: String = DEFAULT_THREAD_NAME_FORMAT
) {
private val threadPoolSize = threadPoolSize ?: DEFAULT_THREAD_POOL_SIZE

companion object {
private const val DEFAULT_THREAD_POOL_SIZE = 10
Expand Down
Loading