ignore exception if JNDI name for TIBCO EMS Destination is not found.

This commit is contained in:
markpollack
2009-12-11 20:00:40 +00:00
parent 21aebecb8d
commit 30f0bc8006

View File

@@ -81,8 +81,13 @@ namespace Spring.Messaging.Ems.Core
protected override void OnSetUp()
{
admin = new Admin("tcp://localhost:7222", "admin", "");
Destination destination = (Destination)lookupContext.Lookup(queueName);
if (destination != null) admin.DestroyQueue(queueName);
Destination destination = null;
try
{
destination = (Destination) lookupContext.Lookup(queueName);
if (destination != null) admin.DestroyQueue(queueName);
} catch (NameNotFoundException)
{}
admin.CreateQueue(new QueueInfo(queueName));
admin.BindQueue(queueName, queueName);
admin.PurgeQueue(queueName);