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

Added automaticTopologyRecovery to Fs2RabbitConfig #972

Merged
merged 3 commits into from
Sep 4, 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
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ object ConnectionResource {
factory.setConnectionTimeout(conf.connectionTimeout.toMillis.toInt)
factory.setRequestedHeartbeat(conf.requestedHeartbeat.toSeconds.toInt)
factory.setAutomaticRecoveryEnabled(conf.automaticRecovery)
factory.setTopologyRecoveryEnabled(conf.automaticTopologyRecovery)
if (conf.ssl) sslCtx.fold(factory.useSslProtocol())(factory.useSslProtocol)
factory.setSaslConfig(saslConf)
conf.username.foreach(factory.setUsername)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ case class Fs2RabbitConfig(
internalQueueSize: Option[Int],
requestedHeartbeat: FiniteDuration,
automaticRecovery: Boolean,
automaticTopologyRecovery: Boolean,
clientProvidedConnectionName: Option[String]
)

Expand All @@ -57,6 +58,7 @@ object Fs2RabbitConfig {
internalQueueSize: Option[Int],
requestedHeartbeat: FiniteDuration = FiniteDuration(ConnectionFactory.DEFAULT_HEARTBEAT, TimeUnit.SECONDS),
automaticRecovery: Boolean = true,
automaticTopologyRecovery: Boolean = true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the default value for the java library, I suppose, is it not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in "modern" versions of that library.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I mean - the one we are using in fs2-rabbit at least

clientProvidedConnectionName: Option[String] = None
): Fs2RabbitConfig = Fs2RabbitConfig(
nodes = NonEmptyList.one(Fs2RabbitNodeConfig(host, port)),
Expand All @@ -70,6 +72,7 @@ object Fs2RabbitConfig {
internalQueueSize = internalQueueSize,
requestedHeartbeat = requestedHeartbeat,
automaticRecovery = automaticRecovery,
clientProvidedConnectionName = clientProvidedConnectionName
clientProvidedConnectionName = clientProvidedConnectionName,
automaticTopologyRecovery = automaticTopologyRecovery
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ object DropwizardMetricsDemo extends IOApp.Simple {
internalQueueSize = Some(500),
requestedHeartbeat = 60.seconds,
automaticRecovery = true,
automaticTopologyRecovery = true,
clientProvidedConnectionName = Some("app:drop-wizard-metrics-demo")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ object IOAckerConsumer extends IOApp.Simple {
internalQueueSize = Some(500),
requestedHeartbeat = 60.seconds,
automaticRecovery = true,
automaticTopologyRecovery = true,
clientProvidedConnectionName = Some("app:io-acker-consumer")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ object RPCDemo extends IOApp.Simple {
internalQueueSize = Some(500),
requestedHeartbeat = 60.seconds,
automaticRecovery = true,
automaticTopologyRecovery = true,
clientProvidedConnectionName = Some("app:rpc-demo")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ trait Fs2RabbitSpec { self: BaseSpec =>
createConnectionChannel.use { implicit channel =>
randomQueueData
.flatMap { case (q, x, _) =>
declareQueue(DeclarationQueueConfig(q, Durable, Exclusive, AutoDelete, Map.empty)) *>
declareQueue(DeclarationQueueConfig(q, Durable, Exclusive, AutoDelete, Map.empty, None)) *>
declareExchange(x, ExchangeType.Topic)
}
.as(emptyAssertion)
Expand Down
Loading