Skip to content

Commit a8adde7

Browse files
author
Emile Joubert
committed
0-9-1 improvements
No more branching on protocol version for connection open and consistent exceptions Better apigen attribute comments
1 parent 3c7b1d4 commit a8adde7

File tree

7 files changed

+4
-31
lines changed

7 files changed

+4
-31
lines changed

projects/client/RabbitMQ.Client/src/client/api/ConnectionFactory.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,7 @@ public virtual IConnection CreateConnection(int maxRedirects)
324324
///No broker-originated redirects are permitted.</summary>
325325
public virtual IConnection CreateConnection()
326326
{
327-
if (Protocol.SupportsRedirect)
328-
{
329-
return CreateConnection(0);
330-
}
331-
else
332-
{
333-
return Protocol.CreateConnection(this, false, Protocol.CreateFrameHandler(Endpoint));
334-
}
327+
return CreateConnection(0);
335328
}
336329
}
337330
}

projects/client/RabbitMQ.Client/src/client/api/IModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,9 @@ public AmqpApigenAttribute(string namespaceName)
763763
///<summary>Causes the API generator to ignore the attributed method.</summary>
764764
///
765765
///<remarks>Mostly used to declare convenience overloads of
766-
///various AMQP methods in the IModel interface. The API
766+
///various AMQP methods in the IModel interface. Also used
767+
///to omit an autogenerated implementation of a method which
768+
///is not required for one protocol version. The API
767769
///autogeneration process should of course not attempt to produce
768770
///an implementation of the convenience methods, as they will be
769771
///implemented by hand with sensible defaults, delegating to the

projects/client/RabbitMQ.Client/src/client/api/IProtocol.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ public interface IProtocol
7474
string ApiName { get; }
7575
///<summary>Retrieve the protocol's default TCP port</summary>
7676
int DefaultPort { get; }
77-
///<summary>Whether redirect is supported</summary>
78-
bool SupportsRedirect { get; }
7977

8078
///<summary>Construct a frame handler for a given endpoint.</summary>
8179
IFrameHandler CreateFrameHandler(AmqpTcpEndpoint endpoint);

projects/client/RabbitMQ.Client/src/client/impl/AbstractProtocolBase.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ public abstract class AbstractProtocolBase: IProtocol {
6565
public abstract int Revision { get; }
6666
public abstract string ApiName { get; }
6767
public abstract int DefaultPort { get; }
68-
public virtual bool SupportsRedirect
69-
{
70-
get { return true; }
71-
}
7268

7369
public abstract IFrameHandler CreateFrameHandler(AmqpTcpEndpoint endpoint);
7470
public abstract IConnection CreateConnection(ConnectionFactory factory,

projects/client/RabbitMQ.Client/src/client/impl/ModelBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,6 @@ public abstract void _Private_ConnectionOpen(string virtualHost,
945945
string capabilities,
946946
bool insist);
947947

948-
public void HandleConnectionOpenOk()
949-
{
950-
ConnectionOpenContinuation k = (ConnectionOpenContinuation)m_continuationQueue.Next();
951-
k.m_redirect = false;
952-
k.m_host = null;
953-
k.HandleCommand(null); // release the continuation.
954-
}
955-
956948
public void HandleConnectionOpenOk(string knownHosts)
957949
{
958950
ConnectionOpenContinuation k = (ConnectionOpenContinuation)m_continuationQueue.Next();

projects/client/RabbitMQ.Client/src/client/impl/v0_9_1/ProtocolBase.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@
6161
namespace RabbitMQ.Client.Framing.Impl.v0_9_1 {
6262
public abstract class ProtocolBase: AbstractProtocolBase {
6363

64-
public override bool SupportsRedirect
65-
{
66-
get { return false; }
67-
}
68-
6964
public override IFrameHandler CreateFrameHandler(AmqpTcpEndpoint endpoint) {
7065
return new SocketFrameHandler_0_9(endpoint);
7166
}

projects/client/Unit/src/unit/TestAuth.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ public void TestAuthFailure()
9393
failureReason);
9494
}
9595
}
96-
catch (PossibleAuthenticationFailureException)
97-
{
98-
}
9996
}
10097
}
10198
}

0 commit comments

Comments
 (0)