qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robbie Gemmell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPIDJMS-332) Defining queue's name as tomcat resource conflichts resource definition
Date Tue, 03 Oct 2017 12:43:00 GMT

    [ https://issues.apache.org/jira/browse/QPIDJMS-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16189660#comment-16189660
] 

Robbie Gemmell commented on QPIDJMS-332:
----------------------------------------

We've made some updates to hopefully enable this to work, changing the client to use "address"
for storing the destination name details rather than "name" (though that is still used if
given, for compatibility for other existing usages).

I hope to do a 0.26.0 release very soon, perhaps even later today or tomorrow, so it would
be useful if you could give this a try on the 0.26.0-SNAPSHOT. You can either build the current
master yourself locally (its mirrored at https://github.com/apache/qpid-jms) or alternatively
snapshots are deployed to https://repository.apache.org/content/repositories/snapshots/ for
testing and the latest build just went run.

> Defining queue's name as tomcat resource conflichts resource definition
> -----------------------------------------------------------------------
>
>                 Key: QPIDJMS-332
>                 URL: https://issues.apache.org/jira/browse/QPIDJMS-332
>             Project: Qpid JMS
>          Issue Type: Improvement
>          Components: qpid-jms-client
>    Affects Versions: 0.25.0
>            Reporter: Bernhard Seidl
>            Assignee: Robbie Gemmell
>             Fix For: 0.26.0
>
>
> Since a few days i am trying to define a queue resource in Tomcat's context.xml. The
attribute "name" defines the jndi name. Looking at org.apache.qpid.jms.JmsDestination 
> the attribute is called "name", too. This seems to me as a  naming conflict. I tried
to use  the attribute "physicalName" due to the fact that some of the classes are based on
ActiveMQ. However I am not sure if I am missing a point somewhere else:
> This is my setup:
> Context.xml
> {code:xml}
> <Resource name="jms/ConnectionFactory" auth="Container"
> 		type="org.apache.qpid.jms.JmsConnectionFactory" factory="org.apache.qpid.jms.jndi.JNDIReferenceFactory"
> 		remoteURI="amqp://10.10.10.1:5672" username="a" password="a"
> 		maxPoolSize="20" connectionTimeout="60000" />
> 	<Resource name="jms/queue" auth="Container"
> 		type="org.apache.qpid.jms.JmsQueue" factory="org.apache.qpid.jms.jndi.JNDIReferenceFactory"
> 		physicalName="name"/>
> {code}
> Init-code using spring:
> {code:java}
> @Configuration
> @EnableJms
> public class MessagingConfiguration {
> 	@Bean
> 	public ConnectionFactory connectionFactory() throws NamingException {
> 		ConnectionFactory connectionFactory =  (new JndiTemplate())
> 				.lookup("java:/comp/env/jms/ConnectionFactory",ConnectionFactory.class);
> 		return connectionFactory;
> 	}
> 	
> 	@Bean
> 	public DestinationResolver destinationResolver() {
> 		JndiDestinationResolver jdr = new JndiDestinationResolver();
> 		try {
> 			// testing
> 			Queue q = jdr.getJndiTemplate().lookup("java:/comp/env/jms/queue", Queue.class);
> 			System.out.println("A: " + q.getQueueName());
> 			System.out.println("B: " + (new JndiTemplate()).lookup("java:/comp/env/jms/queue",
Destination.class).getClass());
> 		} catch (Exception e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
> 		return jdr; 
> 	}
> 	@Bean
> 	public JmsTemplate jmsTemplate() throws NamingException {
> 		JmsTemplate template = new JmsTemplate();
> 		template.setConnectionFactory(connectionFactory());
> 		template.setDestinationResolver(destinationResolver());
> 		return template;
> 	}
> }
> {code}
> Running the code prints out:
> {noformat}
> ...
> A:
> B: class org.apache.qpid.jms.JmsQueue
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message