Skip to content
This repository has been archived by the owner on Oct 8, 2020. It is now read-only.

Commit

Permalink
chore(queue): add an informative toString() in SqlQueue (#120)
Browse files Browse the repository at this point in the history
The QueueProcessor will now display something like `Using queue SqlQueue(queueName=default, poolName=default)`, which can be useful when there are multiple SqlQueue beans around connected to different sql pools
  • Loading branch information
dreynaud authored May 4, 2020
1 parent d523a2f commit 68079a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ class QueueProcessor(

@PostConstruct
fun confirmQueueType() =
log.info("Using ${queue.javaClass.simpleName} queue")
log.info("Using queue $queue")
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,12 @@ class SqlQueue(
private val writeRetryBackoffMax = max(sqlRetryProperties.transactions.backoffMs + 50, 100)

init {
log.info("Configured $javaClass queue: $queueName")
log.info("Configured queue $this")
initTables()
}

override fun toString(): String = "SqlQueue(queueName=$sanitizedName, poolName=$poolName)"

override fun readState(): QueueState {
withPool(poolName) {
return doReadState()
Expand Down

0 comments on commit 68079a5

Please sign in to comment.