You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by fjaouen <fr...@accovia.com> on 2009/07/14 20:18:34 UTC

JMS queue / JNDI instead of physical name

Hi,

I try to use Apache camel JMS (http://camel.apache.org/jms.html). And it
works fine if I use physical name. But I would like to use a logical name
based on JNDI.

For example instead of having:
<camel:route>
	<camel:from uri="jms:queue:MY_PHYSICAL_QUEUE_NAME" />
	<camel:to uri="log:CAMEL" />
</camel:route>

I would like to have:
<camel:route>
	<camel:from uri="jms:queue:MY_LOGICAL_QUEUE_NAME" />
	<camel:to uri="log:CAMEL" />
</camel:route>

Where MY_LOGICAL_QUEUE_NAME is bound to MY_PHYSICAL_QUEUE_NAME.

This would let me the possibility to define physical queue name in a
configuration file.

Is there a way to do that ? And if it is the case could you send me the
receipt ?

Thanks !
-- 
View this message in context: http://www.nabble.com/JMS-queue---JNDI-instead-of-physical-name-tp24484994p24484994.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: JMS queue / JNDI instead of physical name

Posted by fjaouen <fr...@accovia.com>.
Hi,

I try to use the destinationResolver and I was able to use logical name
instead of the physical name.

Thanks.

Here is my configuration:

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
	<property name="configuration" ref="jmsConfiguration" />
	<property name="destinationResolver" ref="jmsDestinationResolver" />
</bean>

<bean id="jmsConfiguration"
class="org.apache.camel.component.jms.JmsConfiguration">
	<property name="connectionFactory" ref="jmsConnectionFactory" />
	<property name="transactionManager" ref="jmsTransactionManager" />
	<property name="transacted" value="true" />
	<property name="concurrentConsumers" value="1" />
</bean>

<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
	<property name="brokerURL" value="tcp://localhost:61616" />
</bean>

<bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
	<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>

<bean id="PROPAGATION_REQUIRED"
class="org.springframework.transaction.support.TransactionTemplate">
	<property name="transactionManager" ref="jmsTransactionManager" />
</bean>

<bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver">
	<property name="jndiTemplate" ref="jndiTemplate" />
	<property name="cache" value="true" />
</bean>

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
	<property name="environment">
	<props>
		<prop
key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
		<prop key="java.naming.provider.url">tcp://localhost:61616</prop>
		<prop key="queue.jndiname">physical.q</prop>
	</props>
	</property>
</bean>



Claus Ibsen-2 wrote:
> 
> Hi
> 
> I kinda recall there is a destination name resolver you can use. A
> person had this question eg 6 months ago (eg a long time ago).
> With this resolver you could do the lookup in jndi and return the real
> destination object found there.
> 
> 
> On Wed, Jul 15, 2009 at 3:15 AM, Willem Jiang<wi...@gmail.com>
> wrote:
>> Hi,
>>
>> Apache camel support the binding the JNDI configure file[1] with the
>> camel
>> context, but current jms component doesn't support it.
>>
>> From current JMS URI, there is no flag to tell camel-jms componement the
>> queue name is JNDI logical name.
>>
>> Please feel free to fill a JIRA[2] as a feature requirement.
>>
>> [1] http://camel.apache.org/jndi.html
>> [2] http://issues.apache.org/activemq/browse/CAMEL
>>
>> Willem
>> fjaouen wrote:
>>>
>>> Hi,
>>>
>>> I try to use Apache camel JMS (http://camel.apache.org/jms.html). And it
>>> works fine if I use physical name. But I would like to use a logical
>>> name
>>> based on JNDI.
>>>
>>> For example instead of having:
>>> <camel:route>
>>>        <camel:from uri="jms:queue:MY_PHYSICAL_QUEUE_NAME" />
>>>        <camel:to uri="log:CAMEL" />
>>> </camel:route>
>>>
>>> I would like to have:
>>> <camel:route>
>>>        <camel:from uri="jms:queue:MY_LOGICAL_QUEUE_NAME" />
>>>        <camel:to uri="log:CAMEL" />
>>> </camel:route>
>>>
>>> Where MY_LOGICAL_QUEUE_NAME is bound to MY_PHYSICAL_QUEUE_NAME.
>>>
>>> This would let me the possibility to define physical queue name in a
>>> configuration file.
>>>
>>> Is there a way to do that ? And if it is the case could you send me the
>>> receipt ?
>>>
>>> Thanks !
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://www.nabble.com/JMS-queue---JNDI-instead-of-physical-name-tp24484994p24502544.html
Sent from the Camel Development mailing list archive at Nabble.com.


Re: JMS queue / JNDI instead of physical name

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I kinda recall there is a destination name resolver you can use. A
person had this question eg 6 months ago (eg a long time ago).
With this resolver you could do the lookup in jndi and return the real
destination object found there.


On Wed, Jul 15, 2009 at 3:15 AM, Willem Jiang<wi...@gmail.com> wrote:
> Hi,
>
> Apache camel support the binding the JNDI configure file[1] with the camel
> context, but current jms component doesn't support it.
>
> From current JMS URI, there is no flag to tell camel-jms componement the
> queue name is JNDI logical name.
>
> Please feel free to fill a JIRA[2] as a feature requirement.
>
> [1] http://camel.apache.org/jndi.html
> [2] http://issues.apache.org/activemq/browse/CAMEL
>
> Willem
> fjaouen wrote:
>>
>> Hi,
>>
>> I try to use Apache camel JMS (http://camel.apache.org/jms.html). And it
>> works fine if I use physical name. But I would like to use a logical name
>> based on JNDI.
>>
>> For example instead of having:
>> <camel:route>
>>        <camel:from uri="jms:queue:MY_PHYSICAL_QUEUE_NAME" />
>>        <camel:to uri="log:CAMEL" />
>> </camel:route>
>>
>> I would like to have:
>> <camel:route>
>>        <camel:from uri="jms:queue:MY_LOGICAL_QUEUE_NAME" />
>>        <camel:to uri="log:CAMEL" />
>> </camel:route>
>>
>> Where MY_LOGICAL_QUEUE_NAME is bound to MY_PHYSICAL_QUEUE_NAME.
>>
>> This would let me the possibility to define physical queue name in a
>> configuration file.
>>
>> Is there a way to do that ? And if it is the case could you send me the
>> receipt ?
>>
>> Thanks !
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: JMS queue / JNDI instead of physical name

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Apache camel support the binding the JNDI configure file[1] with the 
camel context, but current jms component doesn't support it.

 From current JMS URI, there is no flag to tell camel-jms componement 
the queue name is JNDI logical name.

Please feel free to fill a JIRA[2] as a feature requirement.

[1] http://camel.apache.org/jndi.html
[2] http://issues.apache.org/activemq/browse/CAMEL

Willem
fjaouen wrote:
> Hi,
> 
> I try to use Apache camel JMS (http://camel.apache.org/jms.html). And it
> works fine if I use physical name. But I would like to use a logical name
> based on JNDI.
> 
> For example instead of having:
> <camel:route>
> 	<camel:from uri="jms:queue:MY_PHYSICAL_QUEUE_NAME" />
> 	<camel:to uri="log:CAMEL" />
> </camel:route>
> 
> I would like to have:
> <camel:route>
> 	<camel:from uri="jms:queue:MY_LOGICAL_QUEUE_NAME" />
> 	<camel:to uri="log:CAMEL" />
> </camel:route>
> 
> Where MY_LOGICAL_QUEUE_NAME is bound to MY_PHYSICAL_QUEUE_NAME.
> 
> This would let me the possibility to define physical queue name in a
> configuration file.
> 
> Is there a way to do that ? And if it is the case could you send me the
> receipt ?
> 
> Thanks !


Re: JMS queue / JNDI instead of physical name

Posted by Marat Bedretdinov <ma...@gmail.com>.
May be this will help?

http://fusesource.com/docs/router/1.6/component_ref/JMSComp.html

Marat

On Tue, Jul 14, 2009 at 2:18 PM, fjaouen <fr...@accovia.com>wrote:

>
> Hi,
>
> I try to use Apache camel JMS (http://camel.apache.org/jms.html). And it
> works fine if I use physical name. But I would like to use a logical name
> based on JNDI.
>
> For example instead of having:
> <camel:route>
>        <camel:from uri="jms:queue:MY_PHYSICAL_QUEUE_NAME" />
>        <camel:to uri="log:CAMEL" />
> </camel:route>
>
> I would like to have:
> <camel:route>
>        <camel:from uri="jms:queue:MY_LOGICAL_QUEUE_NAME" />
>        <camel:to uri="log:CAMEL" />
> </camel:route>
>
> Where MY_LOGICAL_QUEUE_NAME is bound to MY_PHYSICAL_QUEUE_NAME.
>
> This would let me the possibility to define physical queue name in a
> configuration file.
>
> Is there a way to do that ? And if it is the case could you send me the
> receipt ?
>
> Thanks !
> --
> View this message in context:
> http://www.nabble.com/JMS-queue---JNDI-instead-of-physical-name-tp24484994p24484994.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>
>