Announcement Announcement Module
Collapse
No announcement yet.
JMS Listeners not getting all messages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMS Listeners not getting all messages

    Hi,

    We have a jms queue, ActiveMQ, for message exchange within our aplication components. But we are having a problem atm that i could use some assistance. We have a deployment available on intranet and internet...the listeners are started on the first request ( message sent to the queue ) and that begins our problem. If the listeners are started from internet every message sent by the aplication acessed by the intranet is not read from the queue by the listeners.

    We have another aplication, deployed in the same machine, that starts listeners at startup but they don�t read from the queue.

    Our configuration is Apache -> Tomcat from the internet and acessed directly from Tomcat in the intranet.

    Any ideias or suggestions?

    Thank you

    here is our code sample:

    Sending:
    Code:
    jmsTemplate.setPriority(priority.intValue());		
    
    			jmsTemplate.send(
    					new MessageCreator(){
    						public Message createMessage(Session session)
    						throws JMSException{																					
    							Message msg = session.createMessage();
    
                                                            ....
    							
    							return msg;
    						}
    					}
    			);
    Code:
    	
             <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory">
    		<property name="brokerURL" value="xxx"/>
    		<property name="optimizeAcknowledge" value="true"/> 
    		<property name="userName" value="xxx" /> 
    		<property name="password" value="xxx"/>
    	</bean>
    		
    	<bean id="channelManagerQueue" class="org.apache.activemq.command.ActiveMQQueue">
    		<constructor-arg value=""/>
    	</bean>
    	
    	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    		<property name="connectionFactory" ref="connectionFactory"/>
    		<property name="defaultDestinationName" value="EnterpriseQueue"/>
    		<property name="explicitQosEnabled" value="true"/>
    		<property name="sessionAcknowledgeMode" value="2"/> <!--CLIENT_ACKNOWLEDGE -->
    	</bean>
    	
    	<bean id="sender" class="com.sinfic.sf.platform.channelmanager.jms.AMQJMSConnectorImpl">
    		<constructor-arg ref="jmsTemplate"/>
    	</bean>
    Listener:

    Code:
    public class EmailMessageListener implements SessionAwareMessageListener<Message> {
    
    	@SuppressWarnings("unchecked")
    	@Override
    	public void onMessage(Message message, Session session) throws JMSException {
    		...
          }
    Configuration:
    Code:
    	<bean id="channelListener" class="com.sinfic.sf.platform.emailchannel.jms.EmailMessageListener"/>
    	
    	<bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    		<!-- property name="concurrentConsumers" value="0"/-->
    		<property name="autoStartup" value="false" />
    		<property name="connectionFactory" ref="connectionFactory" />
    		<property name="destinationName" value="EnterpriseQueue" />
    		<property name="messageListener" ref="channelListener" />
    		<property name="messageSelector" value="cm_dest='EM'"/>  
    	</bean>
Working...
X