I've solved it by using spring's ServletContextAttributeExporter <amq:connectionFactory id="amqConnectionFactory" brokerURL="vm://localhost:0"> <property name="userName" value="admin" /> <property name="password" value="password" /> </amq:connectionFactory>
<bean class="org.springframework.web.context.support.ServletContextAttributeExporter" > <property name="attributes"> <map> <entry key="org.apache.activemq.connectionFactory"> <ref bean="amqConnectionFactory"/> </entry> </map> </property> </bean> jackygurui wrote: > > I understand that MessageListenerServlet uses WebClient to send/receive > messages however I could not able to find out how to specify > username/password for the broker to send message. Someone has mentioned > here exactly two years ago, he only pointed out that this can be done > though org.apache.activemq.connectionFactory property, and he did not > provide any code. > > I am wondering if there is a way to configure > org.apache.activemq.connectionFactory property to specify > username/password in the web.xml or somewhere. > -- View this message in context: http://old.nabble.com/How-to-specify-username-and-password-for-MessageListenerServlet-tp27871746p27887206.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.