Skip to content

Commit 4952184

Browse files
committed
bindQueue declaration API fixed
1 parent ab91c86 commit 4952184

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

Migration-6_1-7.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Migration from 6.1.x to 6.2.x
1+
## Migration from 6.1.x to 7.0.x
2+
3+
Additional declarations: `bindQueue` now has more consistent API. The only change is `bindArguments` were renamed to `arguments`.
24

35
Changes in Scala API:
46

core/src/main/resources/reference.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ avastRabbitMQDeclareQueueDefaults {
124124
arguments {}
125125
}
126126

127+
avastRabbitMQBindQueueDefaults {
128+
// queueName = ""
129+
// routingKeys = [""]
130+
// exchangeName = ""
131+
132+
arguments {}
133+
}
134+
127135
avastRabbitMQDeclareExchangeDefaults {
128136
// type = "direct" //fanout, topic
129137
durable = true

core/src/main/scala/com/avast/clients/rabbitmq/DefaultRabbitMQClientFactory.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ private[rabbitmq] object DefaultRabbitMQClientFactory extends LazyLogging {
3333
private[rabbitmq] final val DeclareQueueRootConfigKey = "avastRabbitMQDeclareQueueDefaults"
3434
private[rabbitmq] final val DeclareQueueDefaultConfig = ConfigFactory.defaultReference().getConfig(DeclareQueueRootConfigKey)
3535

36+
private[rabbitmq] final val BindQueueRootConfigKey = "avastRabbitMQBindQueueDefaults"
37+
private[rabbitmq] final val BindQueueDefaultConfig = ConfigFactory.defaultReference().getConfig(BindQueueRootConfigKey)
38+
3639
private[rabbitmq] final val BindExchangeRootConfigKey = "avastRabbitMQBindExchangeDefaults"
3740
private[rabbitmq] final val BindExchangeDefaultConfig = ConfigFactory.defaultReference().getConfig(BindExchangeRootConfigKey)
3841

@@ -203,7 +206,7 @@ private[rabbitmq] object DefaultRabbitMQClientFactory extends LazyLogging {
203206
}
204207

205208
def bindQueue(config: Config, channel: ServerChannel, channelFactoryInfo: RabbitMQConnectionInfo): Task[Unit] = {
206-
bindQueue(config.withFallback(ConsumerBindingDefaultConfig).as[BindQueue], channel, channelFactoryInfo)
209+
bindQueue(config.withFallback(BindQueueDefaultConfig).as[BindQueue], channel, channelFactoryInfo)
207210
}
208211

209212
def bindExchange(config: Config, channel: ServerChannel, channelFactoryInfo: RabbitMQConnectionInfo): Task[Unit] = {
@@ -228,7 +231,7 @@ private[rabbitmq] object DefaultRabbitMQClientFactory extends LazyLogging {
228231
import config._
229232

230233
routingKeys.foreach {
231-
DefaultRabbitMQClientFactory.this.bindQueue(channelFactoryInfo)(channel, queueName)(exchangeName, _, bindArguments.value)
234+
DefaultRabbitMQClientFactory.this.bindQueue(channelFactoryInfo)(channel, queueName)(exchangeName, _, arguments.value)
232235
}
233236
}
234237

core/src/main/scala/com/avast/clients/rabbitmq/configuration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ case class DeclareExchange(name: String, `type`: String, durable: Boolean, autoD
6363

6464
case class DeclareQueue(name: String, durable: Boolean, exclusive: Boolean, autoDelete: Boolean, arguments: DeclareArguments)
6565

66-
case class BindQueue(queueName: String, exchangeName: String, routingKeys: immutable.Seq[String], bindArguments: BindArguments)
66+
case class BindQueue(queueName: String, exchangeName: String, routingKeys: immutable.Seq[String], arguments: BindArguments)
6767

6868
case class BindExchange(sourceExchangeName: String, destExchangeName: String, routingKeys: immutable.Seq[String], arguments: BindArguments)

0 commit comments

Comments
 (0)