Github user srdo commented on a diff in the pull request:
https://github.com/apache/storm/pull/2234#discussion_r128849546
--- Diff:
external/storm-jms/src/main/java/org/apache/storm/jms/spout/JmsSpout.java ---
@@ -30,65 +35,110 @@
import javax.jms.MessageListener;
import javax.jms.Session;
-import org.apache.storm.topology.base.BaseRichSpout;
-import org.apache.storm.utils.Utils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import org.apache.storm.Config;
import org.apache.storm.jms.JmsProvider;
import org.apache.storm.jms.JmsTupleProducer;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.topology.base.BaseRichSpout;
import org.apache.storm.tuple.Values;
+import org.apache.storm.utils.Utils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
/**
- * A Storm <code>Spout</code> implementation that listens to a JMS topic
or queue
- * and outputs tuples based on the messages it receives.
- * <p>
- * <code>JmsSpout</code> instances rely on <code>JmsProducer</code>
implementations
- * to obtain the JMS <code>ConnectionFactory</code> and
<code>Destination</code> objects
- * necessary to connect to a JMS topic/queue.
- * <p>
- * When a <code>JmsSpout</code> receives a JMS message, it delegates to an
- * internal <code>JmsTupleProducer</code> instance to create a Storm tuple
from the
- * incoming message.
- * <p>
- * Typically, developers will supply a custom
<code>JmsTupleProducer</code> implementation
- * appropriate for the expected message content.
+ * A Storm <code>Spout</code> implementation that listens to a JMS topic or
+ * queue and outputs tuples based on the messages it receives.
+ *
+ * <p><code>JmsSpout</code> instances rely on <code>JmsProducer</code>
+ * implementations to obtain the JMS
+ * <code>ConnectionFactory</code> and <code>Destination</code> objects
necessary
+ * to connect to a JMS topic/queue.
+ *
+ * <p>When a <code>JmsSpout</code> receives a JMS message, it delegates to
an
+ * internal <code>JmsTupleProducer</code> instance to create a Storm tuple
from
+ * the incoming message.
+ *
+ * <p>Typically, developers will supply a custom
<code>JmsTupleProducer</code>
+ * implementation appropriate for the expected message content.
*/
@SuppressWarnings("serial")
public class JmsSpout extends BaseRichSpout implements MessageListener {
+
+ /** The logger object instance for this class. */
private static final Logger LOG =
LoggerFactory.getLogger(JmsSpout.class);
- // JMS options
+ /** The logger of the recovery task. */
+ private static final Logger RECOVERY_TASK_LOG =
+ LoggerFactory.getLogger(RecoveryTask.class);
+
+ /** Time to sleep between queue polling attempts. */
+ private static final int POLL_INTERVAL = 50;
--- End diff --
Nit: POLL_INTERVAL_MS. I'm also wondering why this spout is sleeping
manually instead of using the built in functionality for this
https://github.com/apache/storm/blob/64168037fbf383a350c5be7e220ae137d4317411/conf/defaults.yaml#L247
(you don't need to do anything about this, I'm just asking if we should file
an issue for it?).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---