activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sateesh <sk_ac...@yahoo.com>
Subject Messages are getting lost when sent from Spring
Date Thu, 26 Oct 2006 19:12:52 GMT

HI All,

  I am using Spring2.0 to send messages to a Topic in Active MQ 4.0.2

  I have used Hermes to create a Topic (named ProcessSampleTopic) and my
Spring bean config looks as listed below..

   <bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
        <property name="connectionFactory">
            <bean class="org.apache.activemq.ActiveMQConnectionFactory">
                <property name="brokerURL">
                    <value>tcp://localhost:61616</value>
                </property>
            </bean>
        </property>
    </bean>
    <!-- Spring JMS Template -->
    <bean id="myJmsTemplate"
class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory">
            <!-- lets wrap in a pool to avoid creating a connection per send
-->
            <bean
class="org.springframework.jms.connection.SingleConnectionFactory">
                <property name="targetConnectionFactory">
                    <ref local="jmsFactory" />
                </property>
            </bean>
        </property>
    </bean>
    
    <bean id="processSampleTopic"
class="org.apache.activemq.command.ActiveMQTopic"> 
        <constructor-arg index="0" value="ProcessSampleTopic"/> 
    </bean> 

  I am using the below code to send and receive a message and i don't get
any message back and also when i check Hermes for messages in the Topic i
don't find any..

           Topic topic =(Topic)appCtxt.getBean("processSampleTopic");
            jmsTemplate.convertAndSend(topic,"This is a Test Message");
            System.out.println("Done sending the message");
            jmsTemplate.setReceiveTimeout(10000);
            String msg =(String)jmsTemplate.receiveAndConvert(topic);
            System.out.println("Got the message :"+msg);

Pls let me know..

Thanks
Sateesh

-- 
View this message in context: http://www.nabble.com/Messages-are-getting-lost-when-sent-from-Spring-tf2516053.html#a7017808
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message