You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Kuppe <ku...@360t.com> on 2006/07/03 09:51:15 UTC

Configuration for topic/queue and persistence selection

I was reading about your support for jndi using the jndi.properties file. I
assume that this provides a generic way to get a configured destination by
name, so that the type of destination (topic/queue) will be transparent to
the user of the destination. The destination will be looked up in the jndi
context and returned as configured in the property file.

Is it possible to somehow externalize other aspects such as transacted
sessions, persistent producers etc??? Of course it would be ideal if one
could somehow configure outside of the code whether or not a producer
created for a specific destination is going to be producing persistent
messages or not...

Perhaps there is another more elegant way to handle this???

Thanks in advance...
-- 
View this message in context: http://www.nabble.com/Configuration-for-topic-queue-and-persistence-selection-tf1883129.html#a5147811
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Configuration for topic/queue and persistence selection

Posted by James Strachan <ja...@gmail.com>.
On 7/3/06, Kuppe <ku...@360t.com> wrote:
>
> James, thanks for the response.
>
> Can you please qualify your statement "You could use a JmsTemplate and use
> dependency injection"? How exactly would this allow me to externalize the
> configuration of these aspects?

Sorry I missed off the phrase 'Spring' in there...

http://static.springframework.org/spring/docs/1.2.x/reference/jms.html#d0e13024


> Basically i am using an in-house framework for remoting. I assume that this
> would be a common problem with other JMS users also, that a convenient way
> of mapping from a calling context to a specific message sending context
> including whether transacted, persistent or queue or topic... This should
> then be a globally shared context so that all clients use the messaging
> solution consistently. I agree that the jndi solution is not appropriate for
> all of this, but i would have thought that a solution would exist for such a
> commonly recurring problem...

Lingo does this BTW

http://lingo.codehaus.org/

But I repeat, JNDI can only look up a ConnectionFactory and there's no
JMS way to configure persistence or transacted mode on a connection
factory; they have to be specified as you create a session/producer
(unfortunately - I wish there was a way of doing that!). So you need
another abstraction, Spring's JmsTemplate, Lingo or Messager to hide
these details from your application code.

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: Configuration for topic/queue and persistence selection

Posted by Kuppe <ku...@360t.com>.
James, thanks for the response.

Can you please qualify your statement "You could use a JmsTemplate and use
dependency injection"? How exactly would this allow me to externalize the
configuration of these aspects?

Basically i am using an in-house framework for remoting. I assume that this
would be a common problem with other JMS users also, that a convenient way
of mapping from a calling context to a specific message sending context
including whether transacted, persistent or queue or topic... This should
then be a globally shared context so that all clients use the messaging
solution consistently. I agree that the jndi solution is not appropriate for
all of this, but i would have thought that a solution would exist for such a
commonly recurring problem...

Again, your feedback is appreciated!
-- 
View this message in context: http://www.nabble.com/Configuration-for-topic-queue-and-persistence-selection-tf1883129.html#a5148193
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Configuration for topic/queue and persistence selection

Posted by James Strachan <ja...@gmail.com>.
On 7/3/06, Kuppe <ku...@360t.com> wrote:
>
> I was reading about your support for jndi using the jndi.properties file. I
> assume that this provides a generic way to get a configured destination by
> name, so that the type of destination (topic/queue) will be transparent to
> the user of the destination. The destination will be looked up in the jndi
> context and returned as configured in the property file.

Yes


> Is it possible to somehow externalize other aspects such as transacted
> sessions, persistent producers etc???

Unfortunately these configurations are specified when you create a
session/producer from a ConnectionFactory - so there's no way to put
these configurations in JNDI.

You could use a JmsTemplate and use dependency injection.

-- 

James
-------
http://radio.weblogs.com/0112098/