本文整理汇总了C#中IDestination.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IDestination.ToString方法的具体用法?C# IDestination.ToString怎么用?C# IDestination.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDestination
的用法示例。
在下文中一共展示了IDestination.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateConsumer
public IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
{
if (destination == null)
{
throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
}
MessageConsumer consumer = null;
try
{
Queue queue = new Queue(destination.ToString());
consumer = DoCreateMessageConsumer(GetNextConsumerId(), queue, acknowledgementMode);
consumer.ConsumerTransformer = this.ConsumerTransformer;
this.AddConsumer(consumer);
if (this.Connection.IsStarted)
{
consumer.Start();
}
}
catch (Exception)
{
if (consumer != null)
{
this.RemoveConsumer(consumer);
consumer.Close();
}
throw;
}
return consumer;
}
示例2: CreateProducer
public IMessageProducer CreateProducer(IDestination destination)
{
if (destination == null)
{
throw new InvalidDestinationException("Cannot create a Consumer with a Null destination");
}
MessageProducer producer = null;
try
{
Queue queue = new Queue(destination.ToString());
producer = DoCreateMessageProducer(queue);
this.AddProducer(producer);
}
catch (Exception)
{
if (producer != null)
{
this.RemoveProducer(producer.ProducerId);
producer.Close();
}
throw;
}
return producer;
}