qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guenther <GM...@fugro.be>
Subject Re: AMQP_1.0 activemq server side context.xml configuration spring
Date Wed, 23 Oct 2013 10:16:01 GMT
To answer my own question, this is how I made the "Hello World" example work
in my environment:

On the client side, the main problem was the destination which in the
original code goes like this:

Destination destination = (Destination) context.lookup("topicExchange");

This actually will create a DestinationImpl - object. 

I had to change this to 
Destination destination = session.createQueue("businessRequestQueue");
to create a QueueImpl instead of a DestinationImpl for my specific
destination which has the physical name "businessRequestQueue". 
(I didn't know how to make the PropertiesFileInitialContextFactory do this,
so I "hardcoded" it).

On the server side of my real application (which I used to try out the
"Hello world") I replaced the context.xml which I mentioned in my question
by the following: 

<Context reloadable="true">
	<Resource name="jms/ConnectionFactory" auth="Container"
	   description="JMS Connection Factory"

This uses a custom JNDI factory named AMQFactory (because there is not
default constructor in 
org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl) whose code is the

public class AMQFactory implements ObjectFactory 
	public Object getObjectInstance(Object obj, Name name, Context nameCtx,
			Hashtable<?, ?> environment) throws Exception 
		if (name.get(0).equals("ConnectionFactory"))
			return new ConnectionFactoryImpl("localhost", 5672,"", "");
		return null;

Now everything finally works. 

Any comments about other experiences are welcome!


View this message in context: http://qpid.2158936.n2.nabble.com/AMQP-1-0-activemq-server-side-context-xml-configuration-spring-tp7599690p7599828.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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

View raw message