MassTransit 3.1 订阅开始,遇到 "Duplicate type name within an assembly"
MassTransit 3.1 on subscribe start, encountering "Duplicate type name within an assembly"
我使用位于以下位置的示例实施了 MassTransit 解决方案:
http://looselycoupledlabs.com/2014/06/masstransit-publish-subscribe-example/
当发布者和订阅者都是 运行 时,一切正常。
当我停止订阅者并发布更多消息时,我在 RabbitMQ 的 MtPubSubExample_TestSubscriber 队列中看到了预期的就绪状态消息数。
当我重新启动时,订阅者启动它的总线并且只接收队列中的一条消息。剩余的消息被移动到 MtPubSubExample_TestSubscriber_error 队列。如果我将消息铲到原始 MtPubSubExample_TestSubriber 队列,运行 订阅者会毫无问题地接收消息。这似乎是只在启动时出现的问题。
当我是 运行 MassTransit 2.x 版本(和相关代码)时,这个问题不存在。当我升级到 MassTransit 3.1 时才出现这个问题。
我正在使用以下内容:
轨道交通 3.1.0 版
二郎 OTP 18 (7.2.1)
RabbitMQ 服务器版本 3.5.7
当我从错误队列中收到一条消息时,它具有以下详细信息:
交换: MtPubSubExample_TestSubscriber_error
路由键:
重新投递:○
属性:
message_id: 93f80000-b49a-a088-72a7-08d307cc086b
delivery_mode: 2
headers: Content-Type: application/vnd.masstransit+json
MT-Reason: fault
MT-Fault-Message: Duplicate type name within an assembly.
MT-Fault-Timestamp: 2015-12-18T16:55:40.9748103Z
MT-Fault-StackTrace: at System.Reflection.Emit.ModuleBuilder.CheckTypeNameConflict(String strTypeName, Type enclosingType)
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at MassTransit.Internals.Reflection.DynamicImplementationBuilder.CreateTypeFromInterface(ModuleBuilder builder, Type interfaceType)
MT-Host-MachineName: MACHINE1
MT-Host-ProcessName: LearningMT.TestSubscriber.vshost
MT-Host-ProcessId: 12700
MT-Host-Assembly: LearningMT.TestSubscriber
MT-Host-AssemblyVersion: 1.0.0.0
MT-Host-MassTransitVersion: 3.1.0.367
MT-Host-FrameworkVersion: 4.0.30319.42000
MT-Host-OperatingSystemVersion: Microsoft Windows NT 6.1.7601 Service Pack 1
content_type: application/vnd.masstransit+json
有效载荷
983 字节
编码:字符串
{
"messageId": "93f80000-b49a-a088-72a7-08d307cc086b",
"conversationId": "93f80000-b49a-a088-7353-08d307cc086b",
"sourceAddress": "rabbitmq://localhost:5672/bus-MACHINE1-LearningMT.TestPublisher.vshost-1xhyyyfwukoeogj1bdjox19zrq?durable=false&autodelete=true&prefetch=16",
"destinationAddress": "rabbitmq://localhost:5672/LearningMT.MessageContracts:ISomethingHappenedMessage",
"messageType": [
"urn:message:LearningMT.MessageContracts:ISomethingHappenedMessage"
],
"message": {
"what": "Fifth",
"when": "2015-12-18T16:55:28.5292293Z"
},
"headers": {},
"host": {
"machineName": "MACHINE1",
"processName": "LearningMT.TestPublisher.vshost",
"processId": 18992,
"assembly": "LearningMT.TestPublisher",
"assemblyVersion": "1.0.0.0",
"frameworkVersion": "4.0.30319.42000",
"massTransitVersion": "3.1.0.367",
"operatingSystemVersion": "Microsoft Windows NT 6.1.7601 Service Pack 1"
}
}
有没有人见过订阅者启动时从队列中下拉时出现 "Duplicate type name within an assembly" 的问题?
这是在今天早些时候发布的 v3.1.1 中报告并修复的。
我使用位于以下位置的示例实施了 MassTransit 解决方案: http://looselycoupledlabs.com/2014/06/masstransit-publish-subscribe-example/
当发布者和订阅者都是 运行 时,一切正常。
当我停止订阅者并发布更多消息时,我在 RabbitMQ 的 MtPubSubExample_TestSubscriber 队列中看到了预期的就绪状态消息数。
当我重新启动时,订阅者启动它的总线并且只接收队列中的一条消息。剩余的消息被移动到 MtPubSubExample_TestSubscriber_error 队列。如果我将消息铲到原始 MtPubSubExample_TestSubriber 队列,运行 订阅者会毫无问题地接收消息。这似乎是只在启动时出现的问题。
当我是 运行 MassTransit 2.x 版本(和相关代码)时,这个问题不存在。当我升级到 MassTransit 3.1 时才出现这个问题。
我正在使用以下内容: 轨道交通 3.1.0 版 二郎 OTP 18 (7.2.1) RabbitMQ 服务器版本 3.5.7
当我从错误队列中收到一条消息时,它具有以下详细信息:
交换: MtPubSubExample_TestSubscriber_error
路由键:
重新投递:○
属性:
message_id: 93f80000-b49a-a088-72a7-08d307cc086b
delivery_mode: 2
headers: Content-Type: application/vnd.masstransit+json
MT-Reason: fault
MT-Fault-Message: Duplicate type name within an assembly.
MT-Fault-Timestamp: 2015-12-18T16:55:40.9748103Z
MT-Fault-StackTrace: at System.Reflection.Emit.ModuleBuilder.CheckTypeNameConflict(String strTypeName, Type enclosingType)
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, ModuleBuilder module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at MassTransit.Internals.Reflection.DynamicImplementationBuilder.CreateTypeFromInterface(ModuleBuilder builder, Type interfaceType)
MT-Host-MachineName: MACHINE1
MT-Host-ProcessName: LearningMT.TestSubscriber.vshost
MT-Host-ProcessId: 12700
MT-Host-Assembly: LearningMT.TestSubscriber
MT-Host-AssemblyVersion: 1.0.0.0
MT-Host-MassTransitVersion: 3.1.0.367
MT-Host-FrameworkVersion: 4.0.30319.42000
MT-Host-OperatingSystemVersion: Microsoft Windows NT 6.1.7601 Service Pack 1
content_type: application/vnd.masstransit+json
有效载荷 983 字节 编码:字符串
{
"messageId": "93f80000-b49a-a088-72a7-08d307cc086b",
"conversationId": "93f80000-b49a-a088-7353-08d307cc086b",
"sourceAddress": "rabbitmq://localhost:5672/bus-MACHINE1-LearningMT.TestPublisher.vshost-1xhyyyfwukoeogj1bdjox19zrq?durable=false&autodelete=true&prefetch=16",
"destinationAddress": "rabbitmq://localhost:5672/LearningMT.MessageContracts:ISomethingHappenedMessage",
"messageType": [
"urn:message:LearningMT.MessageContracts:ISomethingHappenedMessage"
],
"message": {
"what": "Fifth",
"when": "2015-12-18T16:55:28.5292293Z"
},
"headers": {},
"host": {
"machineName": "MACHINE1",
"processName": "LearningMT.TestPublisher.vshost",
"processId": 18992,
"assembly": "LearningMT.TestPublisher",
"assemblyVersion": "1.0.0.0",
"frameworkVersion": "4.0.30319.42000",
"massTransitVersion": "3.1.0.367",
"operatingSystemVersion": "Microsoft Windows NT 6.1.7601 Service Pack 1"
}
}
有没有人见过订阅者启动时从队列中下拉时出现 "Duplicate type name within an assembly" 的问题?
这是在今天早些时候发布的 v3.1.1 中报告并修复的。