Skip to content

Commit 8ff507e

Browse files
author
Emile Joubert
committed
0-9-1 improvements
Unsupported properties now throw an exception instead of returning meaningless defaults dtx methods are now unsupported instead of notimplement-ed HandleConnectionOpenOk now takes a meaningless knownhosts parameter
1 parent fe05d16 commit 8ff507e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

projects/client/Apigen/src/apigen/Apigen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public void EmitContentHeaderFactory(MethodInfo method) {
857857
EmitLine(" {");
858858
if (Attribute(method, typeof(AmqpUnsupportedAttribute)) != null)
859859
{
860-
EmitLine(String.Format(" return default({0});", method.ReturnType));
860+
EmitLine(String.Format(" throw new UnsupportedMethodException(\"" + method.Name + "\");"));
861861
}
862862
else
863863
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ BasicGetResult BasicGet(string queue,
386386
void TxRollback();
387387

388388
///<summary>(Spec method) Enable DTX mode for this session.</summary>
389-
[AmqpMethodDoNotImplement("RabbitMQ.Client.Framing.v0_9_1")]
389+
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
390390
void DtxSelect();
391391

392392
///<summary>(Spec method)</summary>
393-
[AmqpMethodDoNotImplement("RabbitMQ.Client.Framing.v0_9_1")]
393+
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
394394
void DtxStart(string dtxIdentifier);
395395

396396
///<summary>Close this session.</summary>
@@ -701,7 +701,7 @@ void _Private_ConnectionOpen(string virtualHost,
701701
bool insist);
702702

703703
///<summary>Handle an incoming Connection.OpenOk.</summary>
704-
void HandleConnectionOpenOk([AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
704+
void HandleConnectionOpenOk([AmqpFieldMapping("RabbitMQ.Client.Framing.v0_9_1", "reserved1")]
705705
string knownHosts);
706706

707707
///<summary>Handle an incoming Connection.Redirect.</summary>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public event CallbackExceptionEventHandler CallbackException
146146
m_callbackException -= value;
147147
}
148148
}
149-
}
150-
149+
}
150+
151151
public IBasicConsumer DefaultConsumer { get; set; }
152152

153153
public ISession m_session;
@@ -806,8 +806,8 @@ public abstract void BasicReject(ulong deliveryTag,
806806
public abstract void TxCommit();
807807
public abstract void TxRollback();
808808

809-
public virtual void DtxSelect() { }
810-
public virtual void DtxStart(string dtxIdentifier) { }
809+
public abstract void DtxSelect();
810+
public abstract void DtxStart(string dtxIdentifier);
811811

812812
void IDisposable.Dispose()
813813
{

0 commit comments

Comments
 (0)