activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From javaxmlsoapdev <>
Subject Re: How to create Session while using Jencks
Date Fri, 11 Aug 2006 13:59:40 GMT

Thanks for the response James.

Can you advise, what's wrong with following configs and producer code? I
dont' get any error and code compiles runs fine. but when I run JMX from
activemq directory and try to connect to localhost and port  61613, it keeps
on saying that config wrong , can't connect. That's why I am wondering how
do I validate that my code is creating Queue successfully and putting the
message? Do I miss anything basic? 

activemq.xml is as below.
<broker xmlns="" useJmx="true">
          <policyEntry topic="FOO.>">
              <strictOrderDispatchPolicy />
              <lastImageSubscriptionRecoveryPolicy />

      <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data"/>
       <transportConnector name="default" uri="tcp://localhost:61616"
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
      <networkConnector name="default" uri="multicast://default"/>
---end of activemq.xml--

---start of jencks related config.--
<beans xmlns=""

<!--  lets create an embedded ActiveMQ Broker -->
  <amq:broker useJmx="true" persistent="false">
      <amq:transportConnector uri="tcp://localhost:61616" />
	  <bean id="orderMessageProducer"
       		<constructor-arg ref="jmsTemplate" />
       		<constructor-arg ref="destination" />
	  <!--   ###### Transaction manager ###### -->
	  <bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean" />
	  <bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
	  <bean id="transactionManager"
	    <property name="userTransaction" ref="userTransaction" />
	  <!--  ###### JCA ######  -->
	  <bean id="transactionSupport"
	    <property name="useTransactionCaching" value="true" />
	    <property name="useThreadCaching" value="true" />
	  <bean id="poolingSupport"
	    <property name="maxSize" value="2" />
	    <property name="minSize" value="1" />
	    <property name="blockingTimeoutMilliseconds" value="60" />
	    <property name="idleTimeoutMinutes" value="60" />
	    <property name="matchOne" value="true" />
	    <property name="matchAll" value="true" />
	    <property name="selectOneAssumeMatch" value="true" />
	  <bean id="connectionManager"
	    <property name="transactionSupport" ref="transactionSupport" />
	    <property name="poolingSupport" ref="poolingSupport" />
	  <!-- ###### JMS ######  -->
	  <!-- <bean id="broker"
	    <property name="config" value="/WEB-INF/activemq.xml"/>
	    <property name="start" value="true" />
	  </bean> -->
	  <bean id="jmsResourceAdapter"
	    <property name="serverUrl" value="tcp://localhost:61616" />
	    <!-- <property name="serverUrl" value="tcp://localhost:0" /> -->
	  <bean id="jmsManagedConnectionFactory"
	    <property name="resourceAdapter" ref="jmsResourceAdapter" />
	  <bean id="jmsConnectionFactory"
	    <property name="managedConnectionFactory"
ref="jmsManagedConnectionFactory" />
	    <property name="connectionManager" ref="connectionManager" />
      <bean id="destination"
class="org.apache.activemq.command.ActiveMQQueue" autowire="constructor">
      <bean id="jmsTemplate"
    	<property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="defaultDestination" ref="destination" />

----end of jencks config --

--snippet of producer code --

jmsTemplate.convertAndSend(destination, order,new MessagePostProcessor() {
    	    public Message postProcessMessage(Message message) throws
JMSException {
    	    	message.setObjectProperty("order", "Order Testing");
    	    	message.setStringProperty("JMSXGroupID", "Series1");
    	    	return message;

--end snipped of producer code

James.Strachan wrote:
> On 8/10/06, javaxmlsoapdev <> wrote:
>> I am confused about how to create JMS session pool while using Jencks?
> You don't need to - Jencks does that for you
>> couldn't find any example showing creating pool of sessions. Also, how to
>> use this Jencks created session in Spring Producer code before sending
>> message to broker? Any pointers, examples would be appreciated.
> See this example
> you get a proxy JMS ConnectionFactory that you just use as normal in
> JmsTemplate
> -- 
> James
> -------

View this message in context:
Sent from the ActiveMQ - User forum at

View raw message