尝试使用 MsmqSubscription 存储时发生异常
我是 NService 总线的新手,我正在尝试使用 MSMQSubscribtion storage 创建总线,但出现以下错误。
启动端点时出现异常, 错误已被记录。原因:错误 创建带有名称的对象 'NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage' :设置属性值时出错: 属性访问异常异常 (1 错误);嵌套的 PropertyAccessException 是: [Spring.Core.TypeMismatchException: 无法转换类型的属性值 [System.String] 为所需类型 [System.String] 属性“队列”。, 内部异常: System.ArgumentException:有一个 订阅存储问题 队列 。请参阅随附的例外情况 细节。 ---> System.Messaging.MessageQueueException: 格式名称无效。 在 System.Messaging.MessageQueue.MQCacheableInfo.get_Transactional() 在 System.Messaging.MessageQueue.get_Transactional() 在 NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage.set_Queue(字符串 值)在 d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq\MsmqSubscriptionStorage.cs:line 184 --- 内部异常堆栈跟踪结束 --- 在 NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage.set_Queue(字符串 值)在 d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq\MsmqSubscriptionStorage.cs:行 188 在(对象,对象,对象[]) 在 Spring.Reflection.Dynamic.SafeProperty.SetValue(对象 目标,对象值)中 l:\projects\spring-net\trunk\src\Spring\Spring.Core\Reflection\Dynamic\DynamicProperty.cs:line 204 在 Spring.Expressions.PropertyOrFieldNode.PropertyValueAccessor.Set(对象 上下文,对象值)中 l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line 第585章 在 Spring.Expressions.PropertyOrFieldNode.SetPropertyOrFieldValueInternal(对象 上下文,对象 newValue) 中 l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line 406 在 Spring.Expressions.PropertyOrFieldNode.SetPropertyOrFieldValue(对象 上下文,评估上下文 evalContext,对象 newValue) 中 l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line 348]
这是我的配置部分。
<configuration>
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig,NServiceBus.Core"/>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig,NServiceBus.Core"/>
<section name="MsmqSubscriptionStorageConfig"
type="NServiceBus.Config.MsmqSubscriptionStorageConfig,NServiceBus.Core" />
</configSections>
<MsmqTransportConfig InputQueue="MyResponseQueue" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MyMessages.Message1" Endpoint="PubQueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>
</configuration>
这就是我尝试创建总线的方式,
NServiceBus.Configure.With()
.DefaultBuilder()
.Log4Net()
.MsmqSubscriptionStorage()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.UnicastBus()
.CreateBus();
任何人都可以解释一下我出了什么问题吗? 任何帮助将不胜感激。
谢谢 亚历克斯.
I am newbie in NService bus and I am trying to create a bus using MSMQSubscribtion storage , but I am getting following error.
Exception when starting endpoint,
error has been logged. Reason: Error
creating object with name
'NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage'
: Error setting property values:
PropertyAccessExceptionsException (1
errors); nested
PropertyAccessExceptions are:
[Spring.Core.TypeMismatchException:
Cannot convert property value of type
[System.String] to required type
[System.String] for property 'Queue'.,
Inner Exception:
System.ArgumentException: There is a
problem with the subscription storage
queue . See enclosed exception for
details. --->
System.Messaging.MessageQueueException:
Format name is invalid.
at System.Messaging.MessageQueue.MQCacheableInfo.get_Transactional()
at System.Messaging.MessageQueue.get_Transactional()
at NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage.set_Queue(String
value) in
d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq\MsmqSubscriptionStorage.cs:line
184
--- End of inner exception stack trace ---
at NServiceBus.Unicast.Subscriptions.Msmq.MsmqSubscriptionStorage.set_Queue(String
value) in
d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq\MsmqSubscriptionStorage.cs:line
188
at (Object , Object , Object[] )
at Spring.Reflection.Dynamic.SafeProperty.SetValue(Object
target, Object value) in
l:\projects\spring-net\trunk\src\Spring\Spring.Core\Reflection\Dynamic\DynamicProperty.cs:line
204
at Spring.Expressions.PropertyOrFieldNode.PropertyValueAccessor.Set(Object
context, Object value) in
l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line
585
at Spring.Expressions.PropertyOrFieldNode.SetPropertyOrFieldValueInternal(Object
context, Object newValue) in
l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line
406
at Spring.Expressions.PropertyOrFieldNode.SetPropertyOrFieldValue(Object
context, EvaluationContext
evalContext, Object newValue) in
l:\projects\spring-net\trunk\src\Spring\Spring.Core\Expressions\PropertyOrFieldNode.cs:line
348]
This is my Config section .
<configuration>
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig,NServiceBus.Core"/>
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig,NServiceBus.Core"/>
<section name="MsmqSubscriptionStorageConfig"
type="NServiceBus.Config.MsmqSubscriptionStorageConfig,NServiceBus.Core" />
</configSections>
<MsmqTransportConfig InputQueue="MyResponseQueue" ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5"/>
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="MyMessages.Message1" Endpoint="PubQueue"/>
</MessageEndpointMappings>
</UnicastBusConfig>
</configuration>
This is how I tried to create the bus
NServiceBus.Configure.With()
.DefaultBuilder()
.Log4Net()
.MsmqSubscriptionStorage()
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.UnicastBus()
.CreateBus();
Can any one explain what went wrong for me?
Any help would be much appreciated.
Thanks
Alex.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您缺少实际的 MsmqSubscriptionStorageConfig 部分。这是必需的,并将指向您的订阅队列。
Looks like you are missing the actual MsmqSubscriptionStorageConfig section. This is required and will point to your subscription queue.
如果配置文件中未定义,NServiceBus 将自动使用名为“NServiceBus_Subscriptions”的队列。确保已安装 MSMQ。
NServiceBus will automatically use a queue called "NServiceBus_Subscriptions", if not defined in configuration file. Be sure to have installed MSMQ.