我使用以下示例实现了MassTransit解决方案: http://looselycoupledlabs.com/2014/06/masstransit-publish-subscribe-example/
当发布者和订阅者都在运行时,一切都按预期工作。
当我停止订阅者并发布更多消息时,我看到RabbitMQ中MtPubSubExample_TestSubscriber队列中处于就绪状态的预期消息数。
当我重新启动时,订户启动其总线并仅接收队列中的一条消息。其余消息将移至MtPubSubExample_TestSubscriber_error队列。如果我将消息铲到原始的MtPubSubExample_TestSubriber队列,则正在运行的订阅者会收到没有问题的消息。这似乎只是在启动时出现的问题。
当我使用MassTransit 2.x版本(及相关代码)运行时,此问题不存在。问题出现在我升级到MassTransit 3.1时。
我使用以下内容: MassTransit 3.1.0版 Erlang 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"
}
}
有没有人见过这个问题,其中一个"在一个程序集中复制类型名称"当用户启动时从队列中拉下来时会发生什么?
答案 0 :(得分:0)
这是在今天早些时候发布的v3.1.1中报告并修复的。