I am not sure I follow... When I do ctx.lookup("dyanmicQueues/whatever") what
will this do? Create a queue if one does not exist in the destination amq
server?

What is happening currently on the remote (calling) client: I can access the
factory and create the connection with a session okay, but when I try to do
a lookup for the domain/queue (which I explicitly created by calling
createQueue("domain/queue") on destination amq server) I get queue not
found. 

Is prepending dynamicQueues/ the only way around?



James.Strachan wrote:
> 
> 2009/8/4 jworkman <jwork...@oidev.com>:
>>
>> Yes I read the secion, but it explains about adding it to the
>> jndi.properties
>> file, which I can do for predefined ones but not ones created in memory.
>>
>> dynamicQueues/ don't seem to work when I try to connect from an external
>> client.
> 
> The JNDI provider is local to the client - its not a JNDI server; it
> creates destinations in memory of the JMS client process.
> 
> What happens when you try use the following properties file in your
> client?
> 
>> java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
>> java.naming.provider.url=tcp://xxxxxx:61616
>> java.naming.referral=throw
>> java.naming.factory.object=ConnectionFactory
>>
>> Queue name I am trying to create:
>>
>> domainname/queuename
>>
>>
>> Thanks for your assistance...
>>
>> Jason
>>
>>
>> James.Strachan wrote:
>>>
>>> 2009/8/4 jworkman <jwork...@oidev.com>:
>>>>
>>>> I really need help, I am struggling to create queues and topics in
>>>> ActiveMQ
>>>> and have them accessible from JNDI lookups. I need this
>>>> creation/registration to be done without bringing the server down, and
>>>> done
>>>> without manual configuration.
>>>>
>>>> Something like:
>>>>
>>>> //create the jndi context
>>>> InitialContext jndiContext = new InitialContext(loadConnectionProps());
>>>>
>>>> // Create a ConnectionFactory
>>>> ConnectionFactory connectionFactory = (ConnectionFactory)
>>>> jndiContext.lookup(loadConnectionProps().getProperty(Context.OBJECT_FACTORIES));
>>>>
>>>> // Create a Connection
>>>> Connection connection = connectionFactory.createConnection();
>>>>
>>>> // Create a Session
>>>> Session session = connection.createSession(false,
>>>> Session.AUTO_ACKNOWLEDGE);
>>>>
>>>> // Create the destination (Topic or Queue)
>>>> session.createQueue(qname);
>>>>
>>>> ************this below doesn't work***********
>>>>
>>>> //get the topic from jndi
>>>> topic = (Topic) ctx.lookup(name);
>>>
>>> What names are you looking up?
>>>
>>> Did you read the section on "Dynamically creating destinations" here?
>>> http://activemq.apache.org/jndi-support.html
>>>
>>>
>>> --
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>>
>>> Open Source Integration
>>> http://fusesource.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/AMQ-%2B-Programmatic-Creation-of-Destinations-%2B-Registration-in-JNDI-tp24809685p24809919.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/AMQ-%2B-Programmatic-Creation-of-Destinations-%2B-Registration-in-JNDI-tp24809685p24810211.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to