Skip to content

Commit 6305c85

Browse files
author
Emile Joubert
committed
0.9.1 updates
1 parent 84b571d commit 6305c85

File tree

8 files changed

+61
-19
lines changed

8 files changed

+61
-19
lines changed

dist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ function dist-zips {
131131
"/suppress:RabbitMQ.Client.Framing.v0_8 \
132132
/suppress:RabbitMQ.Client.Framing.v0_8qpid \
133133
/suppress:RabbitMQ.Client.Framing.v0_9 \
134+
/suppress:RabbitMQ.Client.Framing.v0_9_1 \
134135
/suppress:RabbitMQ.Client.Framing.Impl.v0_8 \
135136
/suppress:RabbitMQ.Client.Framing.Impl.v0_8qpid \
136137
/suppress:RabbitMQ.Client.Framing.Impl.v0_9 \
138+
/suppress:RabbitMQ.Client.Framing.Impl.v0_9_1 \
137139
/suppress:RabbitMQ.Client.Impl \
138140
/suppress:RabbitMQ.Client.Apigen.Attributes" \
139141
$NAME_VSN-tmp-xmldoc.zip \

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,13 @@ public string Domain {
7070
return result;
7171
}
7272
}
73+
74+
public bool Reserved
75+
{
76+
get
77+
{
78+
return GetString("@reserved", "") == "1";
79+
}
80+
}
7381
}
7482
}

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ public AmqpMethod(XmlNode n)
6868
{
6969
m_Fields = new ArrayList();
7070
foreach (XmlNode f in n.SelectNodes("field")) {
71-
m_Fields.Add(new AmqpField(f));
71+
72+
AmqpField field = new AmqpField(f);
73+
if (!field.Reserved)
74+
{
75+
m_Fields.Add(field);
76+
}
7277
}
7378
m_ResponseMethods = new ArrayList();
7479
foreach (XmlNode r in n.SelectNodes("response")) {

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

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,29 +1120,35 @@ public void EmitAsynchronousHandlers(ArrayList asynchronousHandlers) {
11201120
string implClass = MangleMethodClass(amqpClass, amqpMethod);
11211121

11221122
EmitLine(" case "+((amqpClass.Index << 16) | amqpMethod.Index)+": {");
1123-
ParameterInfo[] parameters = method.GetParameters();
1123+
ParameterInfo[] parameters = method.GetParameters();
11241124
if (parameters.Length > 0) {
1125-
EmitLine(" "+implClass+" __impl = ("+implClass+") __method;");
1125+
EmitLine(" "+implClass+" __impl = ("+implClass+") __method;");
11261126
EmitLine(" "+method.Name+"(");
11271127
int remaining = parameters.Length;
11281128
foreach (ParameterInfo pi in parameters) {
1129-
if (Attribute(pi, typeof(AmqpUnsupportedAttribute)) != null) {
1130-
// skipping unsupported parameter
1131-
}
1132-
else if (Attribute(pi, typeof(AmqpContentHeaderMappingAttribute)) != null) {
1133-
Emit(" ("+pi.ParameterType+") cmd.Header");
1134-
} else if (Attribute(pi, typeof(AmqpContentBodyMappingAttribute)) != null) {
1135-
Emit(" cmd.Body");
1136-
} else {
1137-
AmqpFieldMappingAttribute fieldMapping =
1138-
Attribute(pi, typeof(AmqpFieldMappingAttribute)) as AmqpFieldMappingAttribute;
1139-
Emit(" __impl.m_"+(fieldMapping == null
1140-
? pi.Name
1141-
: fieldMapping.m_fieldName));
1142-
}
11431129
remaining--;
1144-
if (remaining > 0) {
1145-
EmitLine(",");
1130+
if (Attribute(pi, typeof(AmqpUnsupportedAttribute)) == null)
1131+
{
1132+
if (Attribute(pi, typeof(AmqpContentHeaderMappingAttribute)) != null)
1133+
{
1134+
Emit(" (" + pi.ParameterType + ") cmd.Header");
1135+
}
1136+
else if (Attribute(pi, typeof(AmqpContentBodyMappingAttribute)) != null)
1137+
{
1138+
Emit(" cmd.Body");
1139+
}
1140+
else
1141+
{
1142+
AmqpFieldMappingAttribute fieldMapping =
1143+
Attribute(pi, typeof(AmqpFieldMappingAttribute)) as AmqpFieldMappingAttribute;
1144+
Emit(" __impl.m_" + (fieldMapping == null
1145+
? pi.Name
1146+
: fieldMapping.m_fieldName));
1147+
}
1148+
if (remaining > 0)
1149+
{
1150+
EmitLine(",");
1151+
}
11461152
}
11471153
}
11481154
EmitLine(");");

projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
<ApiGenExe>..\Apigen\build\bin\rabbitmq-dotnet-apigen.exe</ApiGenExe>
4141
</PropertyGroup>
4242
<ItemGroup>
43+
<AmqpSpecs Include="$(AmqpSpec0_9_1)">
44+
<Link>specs\$(AmqpSpec0_9_1BaseName)</Link>
45+
</AmqpSpecs>
4346
<AmqpSpecs Include="$(AmqpSpec0_9)">
4447
<Link>specs\$(AmqpSpec0_9BaseName)</Link>
4548
</AmqpSpecs>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ void HandleChannelClose(ushort replyCode,
659659
void HandleConnectionStart(byte versionMajor,
660660
byte versionMinor,
661661
IDictionary serverProperties,
662+
[AmqpUnsupported("RabbitMQ.Client.Framing.v0_9_1")]
662663
byte[] mechanisms,
663664
byte[] locales);
664665

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ public static IProtocol AMQP_0_9
106106
get { return new RabbitMQ.Client.Framing.v0_9.Protocol(); }
107107
}
108108

109+
public static IProtocol AMQP_0_9_1
110+
{
111+
get { return new RabbitMQ.Client.Framing.v0_9_1.Protocol(); }
112+
}
113+
109114
///<summary>Retrieve the current default protocol variant
110115
///(currently AMQP_0_8)</summary>
111116
public static IProtocol DefaultProtocol

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ public void TestBasicPropertiesNoneCloneV0_9()
102102
TestBasicPropertiesNoneClone(new RabbitMQ.Client.Framing.v0_9.BasicProperties());
103103
}
104104

105+
[Test]
106+
public void TestBasicPropertiesCloneV0_9_1()
107+
{
108+
TestBasicPropertiesClone(new RabbitMQ.Client.Framing.v0_9_1.BasicProperties());
109+
}
110+
111+
[Test]
112+
public void TestBasicPropertiesNoneCloneV0_9_1()
113+
{
114+
TestBasicPropertiesNoneClone(new RabbitMQ.Client.Framing.v0_9_1.BasicProperties());
115+
}
116+
105117
[Test]
106118
public void TestStreamPropertiesCloneV0_8()
107119
{

0 commit comments

Comments
 (0)