PDA

View Full Version : NmsTemplate


steinard
07-19-2007, 01:29 PM
Hi!

I'm configuring the NmsTemplate (thourgh DI) and by looking at all the tests it seems like the DefaultDestination property (if not specified) is always somehow set to queue. How can I through configuration set this to be a topic?

In code, the default destination could be specified like this:

IDestination outDestination = session.GetTopic("topic.name");


Thanks,
Steinar.

steinard
07-20-2007, 12:22 PM
I guess solved it. Found this in NmsTemplate's superclass NmsDestinationAccessor:


/// <summary>
/// Gets or sets a value indicating whether Publish/Subscribe
/// domain (Topics) is used. Otherwise, the Point-to-Point domain
/// (Queues) is used.
///
/// </summary>
/// <remarks>this
/// setting tells what type of destination to create if dynamic destinations are enabled.</remarks>
/// <value><c>true</c> if Publish/Subscribe domain; otherwise, <c>false</c>
/// for the Point-to-Point domain.</value>
public virtual bool PubSubDomain
{
get
{
return pubSubDomain;
}

set
{
this.pubSubDomain = value;
}

}


So in configuration terms I guess I could do something like this:

<object id="DataSourceNmsTemplateId" type="Spring.Messaging.Nms.NmsTemplate, Spring.Messaging.Nms">
<property name="ConnectionFactory" ref="nmsConnectionFactory"/>
<property name="PubSubDomain" value="true"/>
<property name="DefaultDestinationName" value="MessagesToClient"/>
<property name="MessageConverter" ref="VizFeedMessageConverter"/>
</object>


Cheers,
Steinar.