Skip to content

Commit

Permalink
Merge pull request #29 from bluegroundltd/fix/missing-threadpoolsize-…
Browse files Browse the repository at this point in the history
…param

Fix missing threadPoolSize param in TransactionalOutboxBuilder.build
  • Loading branch information
George papadopoulos authored Aug 22, 2024
2 parents 3b247e6 + 3cf2bfe commit 9c6b45f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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

0 comments on commit 9c6b45f

Please sign in to comment.