> Dynamically Creating Topics and Queues
> EMS provides a JNDI implementation that can be used to store topics and queues. Java, C, and C# clients can use the EMS JNDI implementation to lookup topics and queues.
> You can also store topics and queues in any JNDI-compliant naming service or in an LDAP server. Java clients can lookup topics and queues in any JNDI-compliant naming service. C and C# clients use LDAP servers.
> Looking up Administered Objects Stored in EMS describes how to lookup topics and queues from an EMS server. Chapter 1, Using JNDI With Third-Party Naming/Directory Services in the TIBCO Enterprise Message Service Application Integration Guide describes how to look up topics and queues from a third-party JNDI or LDAP server.
> Clients can also create destinations as needed. If a client requests the creation of a destination that already exists, the existing destination is used. If the destination does not exist, and the specification of the topics.conf, queues.conf, or acl.conf files allow the destination, the server dynamically creates the new destination. The new destination inherits properties and permissions from its ancestors as described in Wildcards and Dynamically Created Destinations. The destination is managed by the server as long as clients that use the destination are running.

> | Because dynamic destinations do not appear in the configuration files, a client cannot use JNDI to lookup dynamically created queues and topics.

> The following examples show how to create destinations dynamically:
> Java
> Use the Session object’s createTopic() method to create a topic as a Destination object:
> Destination topic = session.createTopic(topicName);
> Use the Session object’s createQueue() method to create a queue as a Destination object:
> Destination queue = session.createQueue(queueName);
> See the tibjmsMsgProducer.java sample client for a working example.
> C
> Use the tibemsTopic_Create function to create a topic of type tibemsDestination:
> tibemsDestination topic = NULL;
> status = tibemsTopic_Create(&topic,topicName);
> Use the tibemsQueue_Create function to create a queue of type tibemsDestination:
> tibemsDestination queue = NULL;
> status = tibemsQueue_Create(&queue,queueName);
> See the tibemsMsgProducer.c sample client for a working example.
> C#
> Use the Session.CreateTopic method to create a Topic object:
> Destination topic = session.CreateTopic(topicName);
> Use the Session.CreateQueue method to create a Queue object:
> Destination queue = session.CreateQueue(queueName);
> See the csMsgProducer.cs sample client for a working example.

Copyright © TIBCO Software Inc. All Rights Reserved.