Skip to content

Commit

Permalink
stop exception swallowing during topology setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tmasternak authored and bording committed Jul 8, 2020
1 parent b022491 commit c0d1471
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,8 @@ public void SetupSubscription(IModel channel, Type type, string subscriberName)
}

public void TeardownSubscription(IModel channel, Type type, string subscriberName)
{
try
{
channel.ExchangeUnbind(subscriberName, ExchangeName(type), string.Empty, null);
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
// ReSharper restore EmptyGeneralCatchClause
{
// TODO: Any better way to make this idempotent?
}
{
channel.ExchangeUnbind(subscriberName, ExchangeName(type), string.Empty, null);
}

public void Publish(IModel channel, Type type, OutgoingMessage message, IBasicProperties properties)
Expand Down Expand Up @@ -132,16 +123,7 @@ void CreateExchange(IModel channel, string exchangeName)
{
NameValidator.ThrowIfNameIsTooLong(exchangeName);

try
{
channel.ExchangeDeclare(exchangeName, ExchangeType.Fanout, useDurableExchanges);
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
// ReSharper restore EmptyGeneralCatchClause
{
// TODO: Any better way to make this idempotent?
}
channel.ExchangeDeclare(exchangeName, ExchangeType.Fanout, useDurableExchanges);
}

readonly ConcurrentDictionary<Type, string> typeTopologyConfiguredSet = new ConcurrentDictionary<Type, string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,7 @@ void CreateExchange(IModel channel, string exchangeName)
return;
}

try
{
channel.ExchangeDeclare(exchangeName, ExchangeType.Topic, useDurableExchanges);
}
// ReSharper disable EmptyGeneralCatchClause
catch (Exception)
// ReSharper restore EmptyGeneralCatchClause
{

}
channel.ExchangeDeclare(exchangeName, ExchangeType.Topic, useDurableExchanges);
}

string GetRoutingKeyForPublish(Type eventType) => conventions.RoutingKey(eventType);
Expand Down

0 comments on commit c0d1471

Please sign in to comment.