My queue was working just fine until I introduced Topic declaration in Spring
configuration below. I have two config files.  

After introducing producer to topic, at the time of deployment it keeps on
failing weirdly destroying all beans after initialization. what am I doing
wrong? can anyone take a look? thanks. My application required to use queue
for one functionality and topic for the other one. can't both be declared
with same connectionFactory etc?

===============applicationContext.xml========
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd";>

<beans>
        
    <bean id="touchLineProducer"
class="com.mypackage.producer.TouchLineProducer">
                <constructor-arg ref="touchLineJmsTemplate" />
                <constructor-arg ref="topicDestination" />
    </bean>
        
        
        <!-- End TouchLine declaration -->
        
        
            <!-- touch line topic -->
        <bean id="topicDestination"
class="org.apache.activemq.command.ActiveMQTopic" autowire="constructor">
                
<constructor-arg><value>com.mypackage.touchline</value></constructor-arg>
        </bean>
    <!-- touchline jms template -->
        <bean id="touchLineJmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="defaultDestination" ref="topicDestination" />
        <property name="pubSubDomain" value="true" />
        <!-- <property name="deliveryPersistent" value="true" />  -->
    </bean>
        
</beans>
===============End of applicationContext.xml=====

=====spring-embedded.xml==========
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd";>

<beans>
        <bean id="transactionContextManager"
                class="org.jencks.factory.TransactionContextManagerFactoryBean" 
/>
        <bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
        <bean id="transactionSupport"
class="org.jencks.factory.XATransactionFactoryBean">
                <property name="useTransactionCaching">
                        <value>true</value>
                </property>
                <property name="useThreadCaching">
                        <value>false</value>
                </property>
        </bean>
        <bean id="poolingSupport"       
class="org.jencks.factory.SinglePoolFactoryBean">
                <property name="maxSize">
                        <value>20</value>
                </property>
                <property name="minSize">
                        <value>1</value>
                </property>
                <property name="blockingTimeoutMilliseconds">
                        <value>60</value>
                </property>
                <property name="idleTimeoutMinutes">
                        <value>60</value>
                </property>
                <property name="matchOne">
                        <value>true</value>
                </property>
                <property name="matchAll">
                        <value>true</value>
                </property>
                <property name="selectOneAssumeMatch">
                        <value>true</value>
                </property>
        </bean>

        <bean id="connectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">
                <property name="transactionSupport">
                        <ref local="transactionSupport" />
                </property>
                <property name="poolingSupport">
                        <ref local="poolingSupport" />
                </property>
        </bean>

<!--  
        <bean id="broker"
                class="org.apache.activemq.xbean.BrokerFactoryBean">
                <property name="config" value="/WEB-INF/activemq.xml" />
        </bean>
-->
        <bean id="jmsResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
                <property name="serverUrl" value="tcp://localhost:61616" />
        </bean>

        <bean id="jmsManagedConnectionFactory"
class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
                <property name="resourceAdapter">
                        <ref local="jmsResourceAdapter" />
                </property>
        </bean>

        <bean id="jmsConnectionFactory"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
                <property name="managedConnectionFactory">
                        <ref local="jmsManagedConnectionFactory" />
                </property>
                <property name="connectionManager">
                        <ref local="connectionManager" />
                </property>
        </bean>

        <bean id="destination"  
class="org.apache.activemq.command.ActiveMQQueue"
                autowire="constructor">
                <constructor-arg>
                        <value>com.ats.fts.queue.order.embedded</value>
                </constructor-arg>
        </bean>

        <bean id="tradeDestination"
class="org.apache.activemq.command.ActiveMQQueue"
                autowire="constructor">
                <constructor-arg>
                        <value>com.ats.fts.queue.trade.embedded</value>
                </constructor-arg>
        </bean>
        <bean id="jencks" class="org.jencks.JCAContainer">

                <!-- lets use the default configuration of work manager and 
transaction
manager-->
                <property name="bootstrapContext">
                        <bean
                                
class="org.jencks.factory.BootstrapContextFactoryBean">
                                <property name="threadPoolSize" value="25" />
                        </bean>
                </property>


                <!-- the JCA Resource Adapter -->
                <property name="resourceAdapter">
                        <bean id="activeMQResourceAdapter"
                                
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
                                <property name="serverUrl"
                                        value="tcp://localhost:61616" />
                        </bean>
                </property>
        </bean>
        <bean id="jmsTemplate"
                class="org.springframework.jms.core.JmsTemplate">
                <property name="connectionFactory" ref="jmsConnectionFactory" />
                <property name="defaultDestination" ref="destination" />
        </bean>

        <bean id="inboundConnectorA" class="org.jencks.JCAConnector">
                <property name="jcaContainer" ref="jencks" />
                <property name="activationSpec">
                        <bean
                                
class="org.apache.activemq.ra.ActiveMQActivationSpec">
                                <property name="destination"
                                        
value="com.ats.fts.queue.order.embedded" />
                                <property name="destinationType"
                                        value="javax.jms.Queue" />
                        </bean>
                </property>
                <property name="ref" value="orderMessageConsumer" />
        </bean>

        <bean id="inboundConnectorB" class="org.jencks.JCAConnector">
                <property name="jcaContainer" ref="jencks" />
                <property name="activationSpec">
                        <bean
                                
class="org.apache.activemq.ra.ActiveMQActivationSpec">
                                <property name="destination"
                                        
value="com.ats.fts.queue.trade.embedded" />
                                <property name="destinationType"
                                        value="javax.jms.Queue" />
                        </bean>
                </property>
                <property name="ref" value="stopLossOrderMessageConsumer" />
        </bean>

        <bean id="orderMessageConsumer"
                class="com.ats.fts.consumer.OrderMessageConsumer" 
singleton="true">
                <property name="orderService">
                        <ref bean="orderService" />
                </property>
                <property name="matchHandlerFactory">
                        <ref bean="matchHandlerFactory" />
                </property>
        </bean>
                <bean id="stopLossOrderMessageConsumer"
                class="com.ats.fts.consumer.StopLossOrderMessageConsumer"
singleton="true">
                <property name="orderService">
                        <ref bean="orderService" />
                </property>
        </bean>
</beans>
=========end spring-embedded.xml============
-- 
View this message in context: 
http://www.nabble.com/ActiveMQTopic%2C-Queue-together-not-working-tf2495416.html#a6956902
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to