[GitHub] storm pull request #2024: STORM-2349: Add one RocketMQ plugin for the Apache...

2017-04-02 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2024#discussion_r109309713
  
--- Diff: external/storm-rocketmq/pom.xml ---
@@ -0,0 +1,89 @@
+
+
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+4.0.0
+
+
+storm
+org.apache.storm
+2.0.0-SNAPSHOT
+../../pom.xml
+
+
+storm-rocketmq
+storm-rocketmq
+
+jar
+
+
+
+vesense
+Xin Wang
+xinw...@apache.org
+
+
+
+
+
+
+org.apache.storm
+storm-core
+${project.version}
+provided
+
+
+org.apache.rocketmq
+rocketmq-client
+4.0.0-incubating
+
+
+commons-lang
+commons-lang
--- End diff --

No need, RocketMQ client has dependency commons-lang3, which is a next 
generation for commons lang package~


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #2024: STORM-2349: Add one RocketMQ plugin for the Apache...

2017-04-02 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2024#discussion_r109309839
  
--- Diff: 
external/storm-rocketmq/src/main/java/org/apache/storm/rocketmq/spout/RocketMQSpout.java
 ---
@@ -0,0 +1,179 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.storm.rocketmq.spout;
+
+import org.apache.commons.lang.Validate;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+import org.apache.rocketmq.client.consumer.MQPushConsumer;
+import 
org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
+import 
org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
+import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
+import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
+import 
org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
+import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly;
+import org.apache.rocketmq.client.exception.MQClientException;
+import org.apache.rocketmq.common.message.MessageExt;
+import org.apache.storm.Config;
+import org.apache.storm.rocketmq.DefaultMessageRetryManager;
+import org.apache.storm.rocketmq.MessageRetryManager;
+import org.apache.storm.rocketmq.MessageSet;
+import org.apache.storm.rocketmq.RocketMQConfig;
+import org.apache.storm.rocketmq.SpoutConfig;
+import org.apache.storm.spout.SpoutOutputCollector;
+import org.apache.storm.task.TopologyContext;
+import org.apache.storm.topology.IRichSpout;
+import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.tuple.Fields;
+import org.apache.storm.tuple.Values;
+import org.apache.storm.utils.Utils;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import static org.apache.storm.rocketmq.RocketMQUtils.getBoolean;
+import static org.apache.storm.rocketmq.RocketMQUtils.getInteger;
+
+/**
+ * RocketMQSpout uses MQPushConsumer as the default implementation.
+ * PushConsumer is a high level consumer API, wrapping the pulling details
+ * Looks like broker push messages to consumer
+ */
+public class RocketMQSpout implements IRichSpout {
+// TODO add metrics
+
+private MQPushConsumer consumer;
+private SpoutOutputCollector collector;
+private boolean ordered;
+private BlockingQueue queue;
+
+private Properties properties;
+private MessageRetryManager messageRetryManager;
+
+public RocketMQSpout(Properties properties) {
+this.properties = properties;
+}
+
+@Override
+public void open(Map conf, TopologyContext context, 
SpoutOutputCollector collector) {
+Validate.notEmpty(properties, "Consumer properties can not be 
empty");
+ordered = 
getBoolean(properties,RocketMQConfig.CONSUMER_MESSAGES_ORDERLY, false);
+
+int queueSize = getInteger(properties, SpoutConfig.QUEUE_SIZE, 
Utils.getInt(conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING)));
+queue = new LinkedBlockingQueue<>(queueSize);
+
+consumer = new DefaultMQPushConsumer();
+RocketMQConfig.buildConsumerConfigs(properties, 
(DefaultMQPushConsumer)consumer, context);
+
+if (ordered) {
+consumer.registerMessageListener(new MessageListenerOrderly() {
+@Override
+public ConsumeOrderlyStatus 
consumeMessage(List msgs,
+   
ConsumeOrderlyContext context) {
+if (process(msgs)) {
+return ConsumeOrderlyStatus.SUCCESS;
+} else {
+return 
ConsumeOrderlyS

[GitHub] storm pull request #2024: STORM-2349: Add one RocketMQ plugin for the Apache...

2017-04-02 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2024#discussion_r109309759
  
--- Diff: external/storm-rocketmq/pom.xml ---
@@ -0,0 +1,89 @@
+
+
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+4.0.0
+
+
+storm
+org.apache.storm
+2.0.0-SNAPSHOT
+../../pom.xml
+
+
+storm-rocketmq
+storm-rocketmq
+
+jar
+
+
+
+vesense
+Xin Wang
+xinw...@apache.org
+
+
+
+
+
+
+org.apache.storm
+storm-core
+${project.version}
+provided
+
+
+org.apache.rocketmq
+rocketmq-client
+4.0.0-incubating
+
+
+commons-lang
+commons-lang
+
+
+
+org.mockito
+mockito-core
+test
+${mockito.version}
+
+
+org.slf4j
+log4j-over-slf4j
+test
--- End diff --

Does the latest storm core still dependency log4j?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #2024: STORM-2349: Add one RocketMQ plugin for the Apache...

2017-04-10 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2024#discussion_r110601839
  
--- Diff: 
external/storm-rocketmq/src/main/java/org/apache/storm/rocketmq/RocketMQConfig.java
 ---
@@ -0,0 +1,172 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.storm.rocketmq;
+
+import org.apache.commons.lang.Validate;
+import org.apache.rocketmq.client.ClientConfig;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+import org.apache.rocketmq.client.exception.MQClientException;
+import org.apache.rocketmq.client.producer.DefaultMQProducer;
+import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
+import org.apache.rocketmq.remoting.common.RemotingUtil;
+import org.apache.storm.task.TopologyContext;
+
+import java.util.Properties;
+import java.util.UUID;
+
+import static org.apache.storm.rocketmq.RocketMQUtils.getInteger;
+
+/**
+ * RocketMQConfig for Consumer/Producer
+ */
+public class RocketMQConfig {
+// common
+public static final String NAME_SERVER_ADDR = "nameserver.addr"; // 
Required
+
+public static final String CLIENT_NAME = "client.name";
+
+public static final String CLIENT_IP = "client.ip";
+public static final String DEFAULT_CLIENT_IP = 
RemotingUtil.getLocalAddress();
+
+public static final String CLIENT_CALLBACK_EXECUTOR_THREADS = 
"client.callback.executor.threads";
+public static final int DEFAULT_CLIENT_CALLBACK_EXECUTOR_THREADS = 
Runtime.getRuntime().availableProcessors();;
+
+public static final String NAME_SERVER_POLL_INTERVAL = 
"nameserver.poll.interval";
+public static final int DEFAULT_NAME_SERVER_POLL_INTERVAL = 3; // 
30 seconds
+
+public static final String BROKER_HEART_BEAT_INTERVAL = 
"brokerserver.heartbeat.interval";
+public static final int DEFAULT_BROKER_HEART_BEAT_INTERVAL = 3; // 
30 seconds
+
+
+// producer
+public static final String PRODUCER_GROUP = "producer.group";
+
+public static final String PRODUCER_RETRY_TIMES = 
"producer.retry.times";
+public static final int DEFAULT_PRODUCER_RETRY_TIMES = 2;
+
+public static final String PRODUCER_TIMEOUT = "producer.timeout";
+public static final int DEFAULT_PRODUCER_TIMEOUT = 3000; // 3 seconds
+
+
+// consumer
+public static final String CONSUMER_GROUP = "consumer.group"; // 
Required
+
+public static final String CONSUMER_TOPIC = "consumer.topic"; // 
Required
+
+public static final String CONSUMER_TAG = "consumer.tag";
+public static final String DEFAULT_TAG = "*";
+
+public static final String CONSUMER_OFFSET_RESET_TO = 
"consumer.offset.reset.to";
+public static final String CONSUMER_OFFSET_LATEST = "latest";
+public static final String CONSUMER_OFFSET_EARLIEST = "earliest";
+public static final String CONSUMER_OFFSET_TIMESTAMP = "timestamp";
+
+public static final String CONSUMER_MESSAGES_ORDERLY = 
"consumer.messages.orderly";
+
+public static final String CONSUMER_OFFSET_PERSIST_INTERVAL = 
"consumer.offset.persist.interval";
+public static final int DEFAULT_CONSUMER_OFFSET_PERSIST_INTERVAL = 
5000; // 5 seconds
+
+public static final String CONSUMER_MIN_THREADS = 
"consumer.min.threads";
+public static final int DEFAULT_CONSUMER_MIN_THREADS = 20;
+
+public static final String CONSUMER_MAX_THREADS = 
"consumer.max.threads";
+public static final int DEFAULT_CONSUMER_MAX_THREADS = 64;
+
+
+public static void buildProducerConfigs(Properties props, 
DefaultMQProducer producer, TopologyContext context) {
+buildCommonConfigs(pr

[GitHub] storm pull request #2024: STORM-2349: Add one RocketMQ plugin for the Apache...

2017-04-13 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2024#discussion_r111533311
  
--- Diff: 
external/storm-rocketmq/src/main/java/org/apache/storm/rocketmq/spout/RocketMQSpout.java
 ---
@@ -0,0 +1,189 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.storm.rocketmq.spout;
+
+import org.apache.commons.lang.Validate;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+import org.apache.rocketmq.client.consumer.MQPushConsumer;
+import 
org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
+import 
org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
+import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
+import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
+import 
org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
+import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly;
+import org.apache.rocketmq.client.exception.MQClientException;
+import org.apache.rocketmq.common.message.MessageExt;
+import org.apache.storm.Config;
+import org.apache.storm.rocketmq.DefaultMessageRetryManager;
+import org.apache.storm.rocketmq.MessageRetryManager;
+import org.apache.storm.rocketmq.MessageSet;
+import org.apache.storm.rocketmq.RocketMQConfig;
+import org.apache.storm.rocketmq.SpoutConfig;
+import org.apache.storm.spout.SpoutOutputCollector;
+import org.apache.storm.task.TopologyContext;
+import org.apache.storm.topology.IRichSpout;
+import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.tuple.Fields;
+import org.apache.storm.tuple.Values;
+import org.apache.storm.utils.ObjectReader;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import static org.apache.storm.rocketmq.RocketMQUtils.getBoolean;
+import static org.apache.storm.rocketmq.RocketMQUtils.getInteger;
+
+/**
+ * RocketMQSpout uses MQPushConsumer as the default implementation.
+ * PushConsumer is a high level consumer API, wrapping the pulling details
+ * Looks like broker push messages to consumer
+ */
+public class RocketMQSpout implements IRichSpout {
+// TODO add metrics
+
+private static MQPushConsumer consumer;
+private SpoutOutputCollector collector;
+private BlockingQueue queue;
+
+private Properties properties;
+private MessageRetryManager messageRetryManager;
+
+public RocketMQSpout(Properties properties) {
+this.properties = properties;
+}
+
+@Override
+public void open(Map conf, TopologyContext context, 
SpoutOutputCollector collector) {
+Validate.notEmpty(properties, "Consumer properties can not be 
empty");
+boolean ordered = getBoolean(properties, 
RocketMQConfig.CONSUMER_MESSAGES_ORDERLY, false);
+
+int queueSize = getInteger(properties, SpoutConfig.QUEUE_SIZE, 
ObjectReader.getInt(conf.get(Config.TOPOLOGY_MAX_SPOUT_PENDING)));
+queue = new LinkedBlockingQueue<>(queueSize);
+
+// Since RocketMQ Consumer is thread-safe, RocketMQSpout uses a 
single
+// consumer instance across threads to improve the performance.
+synchronized (RocketMQSpout.class) {
+if (consumer == null) {
+consumer = new DefaultMQPushConsumer();
+RocketMQConfig.buildConsumerConfigs(properties, 
(DefaultMQPushConsumer)consumer);
+
+if (ordered) {
+consumer.registerMessageListener(new 
MessageListenerOrderly() {
--- End diff --

yes


---
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 

[GitHub] storm issue #2024: STORM-2349: Add one RocketMQ plugin for the Apache Storm

2017-04-23 Thread vongosling
Github user vongosling commented on the issue:

https://github.com/apache/storm/pull/2024
  
Great ~


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] storm pull request #2518: STORM-2902: Some improvements for storm-rocketmq m...

2018-02-06 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2518#discussion_r166494277
  
--- Diff: 
external/storm-rocketmq/src/main/java/org/apache/storm/rocketmq/RocketMqConfig.java
 ---
@@ -23,28 +23,20 @@
 import java.util.Properties;
 import java.util.UUID;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.Validate;
 import org.apache.rocketmq.client.ClientConfig;
 import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
 import org.apache.rocketmq.client.exception.MQClientException;
 import org.apache.rocketmq.client.producer.DefaultMQProducer;
 import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
-import org.apache.rocketmq.remoting.common.RemotingUtil;
 
 /**
  * RocketMqConfig for Consumer/Producer.
  */
--- End diff --

RocketMQ


---


[GitHub] storm pull request #2518: STORM-2902: Some improvements for storm-rocketmq m...

2018-02-06 Thread vongosling
Github user vongosling commented on a diff in the pull request:

https://github.com/apache/storm/pull/2518#discussion_r166494139
  
--- Diff: external/storm-rocketmq/README.md ---
@@ -1,6 +1,6 @@
 # Storm RocketMQ
 
-Storm/Trident integration for 
[RocketMQ](https://rocketmq.incubator.apache.org/). This package includes the 
core spout, bolt and trident states that allows a storm topology to either 
write storm tuples into a topic or read from topics in a storm topology.
+Storm/Trident integration for [RocketMQ](https://rocketmq.apache.org/). 
This package includes the core spout, bolt and trident states that allows a 
storm topology to either write storm tuples into a topic or read from topics in 
a storm topology.
--- End diff --

great!


---


[GitHub] storm issue #2518: STORM-2902: Some improvements for storm-rocketmq module

2018-02-06 Thread vongosling
Github user vongosling commented on the issue:

https://github.com/apache/storm/pull/2518
  
@HeartSaVioR RocketMQ is another high performance messaging and low latency 
engine in Apache, I am glad to introduce it to your storm guys :-)


---


[GitHub] storm issue #2518: STORM-2902: Some improvements for storm-rocketmq module

2018-02-22 Thread vongosling
Github user vongosling commented on the issue:

https://github.com/apache/storm/pull/2518
  
glad to see the update of this pr :-)


---


[GitHub] storm issue #2518: STORM-2902: Some improvements for storm-rocketmq module

2018-04-03 Thread vongosling
Github user vongosling commented on the issue:

https://github.com/apache/storm/pull/2518
  
Good Catch, what's the plan for this pr? I noticed that we have kept the 
unmerged status for a long time.


---


[jira] [Commented] (STORM-717) Proposal: JStorm contribution from Alibaba

2015-03-25 Thread vongosling (JIRA)

[ 
https://issues.apache.org/jira/browse/STORM-717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14379405#comment-14379405
 ] 

vongosling commented on STORM-717:
--

Come on,that‘s real a challenging work.I am  looking forward to contribute too.

> Proposal: JStorm contribution from Alibaba
> --
>
> Key: STORM-717
> URL: https://issues.apache.org/jira/browse/STORM-717
> Project: Apache Storm
>  Issue Type: Umbrella
>Reporter: Sean Zhong
>Assignee: Longda Feng
>
> This is a umbrella case for the code contribution from Jstorm project. Please 
> follow in this root jira to raise concerns and make discussions. All 
> discussion in dev list or votes shall have a link posted in this unbrella 
> jira.
> The suggested steps and principals:
> Principal for the JStorm contribution
> 1.  All job jars in Storm can be migrated directly without recompilation.
> 2.  Functions of JStorm will be merged into Storm.
> 3.  Most user facing function or user experience of Storm will be 
> retained.
> 4.  There will be performance improvement.
> 5.  The process should be Smooth with incremental and tractable progress.
> Need consense and further discussion
> What is the best approach to evolve Clojure and Java(need more discussion on 
> this) the two languages in future? More on Java?
> Proposed Steps:
> 1.  IP donation
> We should follow process of http://incubator.apache.org/ip-clearance/, 
> a)  Identity the code base,  which tag version to choose as a basis. MD5 
> for the code base.
> b)   IP Plan (copyright)
> c)   distribution right, ICLA
> 2.  Determine the folder layout required for Storm, so that we can then 
> easily break the effort to module level. 
> 3.  Continue the discussion and get a consensus of everyone in community 
> about relation of Clojure and Java.
> 4.  Define process
> a)   whether to create a Branch?
> b)   What is the target Feature list?
> c)What is the target feature Order?
> d)   What is the target Time line?
> e)   What is the Target Version?
> References:
> Jstorm site: https://github.com/alibaba/jstorm
> Original Discussion about JStorm and Storm: 
> http://mail-archives.apache.org/mod_mbox/storm-dev/201410.mbox/%3C005701cfef39%245efd8100%241cf88300%24%40alibaba-inc.com%3E



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)