blob: 18115da0b38e4c1c943e51cf3a2d72f3e9e4b0a6 [file] [log] [blame]
<div class="wiki-content maincontent"><h3>I am not receiving any messages - what is wrong?</h3>
<p>A <em>very</em> common gotcha when working with JMS is forgetting to start the JMS connection, creating a consumer and not having it receive any messages. I myself have tripped up over this one many many times! <emoticon ac:name="smile"></emoticon></p>
<p>Make sure you call the <a shape="rect" href="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Connection.html#start()">start()</a> method on the JMS connection, otherwise messages will not be dispatched to your consumer.</p>
<p>This is such a common gotcha that as of 4.2 onwards, ActiveMQ will now <a shape="rect" href="https://issues.apache.org/activemq/browse/AMQ-1253">log a warning if a message</a> is received shortly after the connection was created if the connection was not started (as its so easy to forget to do this part <emoticon ac:name="smile"></emoticon>. </p>
<p>For more details see the discussion of the <strong>warnAboutUnstartedConnectionTimeout</strong> property on the <link><page ri:content-title="Connection Configuration URI"></page></link></p>
<h3>If you are calling connection.start()</h3>
<p>Another common gotcha is <link><page ri:content-title="I do not receive messages in my second consumer"></page><link-body>due to another consumer grabbing the messages</link-body></link>. If its not that then please look at <link><page ri:content-title="JMX"></page></link> or the <link><page ri:content-title="Web Console"></page></link> to determine what consumers are available and their status. Then get some <link><page ri:content-title="Support"></page></link> to help you resolve your issue.</p></div>