[ISSUE #223]remove unnecessary script in travis.yml
* fix(Travis): remove unnecessary script in travis.yml
diff --git a/.travis.yml b/.travis.yml
index 6906b5f..99f27b5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,24 +17,12 @@
before_install:
- cd ${TRAVIS_HOME}
- - wget https://opensource-rocketmq-client-us.oss-us-west-1.aliyuncs.com/cpp-client/linux/1.2.0/RHEL7.x/librocketmq.tar.gz
+ - wget https://opensource-rocketmq-client-us.oss-us-west-1.aliyuncs.com/cpp-client/linux/1.2.4/RHEL7.x/librocketmq.tar.gz
- tar -xzf librocketmq.tar.gz
- sudo cp librocketmq.so librocketmq.a /usr/local/lib/
- sudo cp -r rocketmq /usr/local/include/
- cd ${GOPATH}/src/github.com/apache/rocketmq-client-go
-before_script:
- - cd ${TRAVIS_HOME}
- - wget http://us.mirrors.quenda.co/apache/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip
- - unzip rocketmq-all-4.3.2-bin-release.zip
- - cd rocketmq-all-4.3.2-bin-release
- - perl -i -pe's/-Xms8g -Xmx8g -Xmn4g/-Xms2g -Xmx2g -Xmn1g/g' bin/runbroker.sh
- - nohup sh bin/mqnamesrv &
- - nohup sh bin/mqbroker -n localhost:9876 &
- - sleep 10
- - ./bin/mqadmin updateTopic -n ${NAME_SERVER_ADDRESS} -b ${BROKER_ADDRESS} -t ${TOPIC}
- - ./bin/mqadmin updateSubGroup -n ${NAME_SERVER_ADDRESS} -b ${BROKER_ADDRESS} -g ${GROUP}
-
script:
- export LD_LIBRARY_PATH=/usr/local/lib
- cd ${GOPATH}/src/github.com/apache/rocketmq-client-go
diff --git a/core/api_test.go b/core/api_test.go
index 01f360b..0c09dae 100644
--- a/core/api_test.go
+++ b/core/api_test.go
@@ -36,11 +36,12 @@
pConfig.SendMsgTimeout = 30
pConfig.CompressLevel = 4
pConfig.MaxMessageSize = 1024
+ pConfig.ProducerModel = CommonProducer
expect := "ProducerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: producerGroupName, InstanceName: testProducer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, S" +
- "endMsgTimeout: 30, CompressLevel: 4, MaxMessageSize: 1024, ]"
+ "endMsgTimeout: 30, CompressLevel: 4, MaxMessageSize: 1024, ProducerModel: CommonProducer, ]"
assert.Equal(t, expect, pConfig.String())
}
@@ -56,22 +57,27 @@
FileSize: 1 << 20,
Level: LogLevelDebug}
pcConfig.ThreadCount = 4
- expect := "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, " +
- "GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
- "LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, ]"
+ pcConfig.MessageBatchMaxSize = 1024
+ expect := "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, GroupName: consumerGroupName, " +
+ "InstanceName: testPushConsumer, LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, " +
+ "ThreadCount: 4, MessageBatchMaxSize: 1024, ]"
assert.Equal(t, expect, pcConfig.String())
pcConfig.NameServerDomain = "domain1"
expect = "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
- "LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, ]"
+ "LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, MessageBatchMaxSize: 1024, ]"
assert.Equal(t, expect, pcConfig.String())
pcConfig.MessageBatchMaxSize = 32
pcConfig.Model = Clustering
+ pcConfig.ConsumerModel = CoCurrently
+ pcConfig.MaxCacheMessageSize = 1024
+ pcConfig.MaxCacheMessageSizeInMB = 2048
expect = "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4," +
- " MessageBatchMaxSize: 32, MessageModel: Clustering, ]"
+ " MessageBatchMaxSize: 32, MessageModel: Clustering, ConsumerModel: CoCurrently," +
+ " MaxCacheMessageSize: 1024, MaxCacheMessageSizeInMB: 2048, ]"
assert.Equal(t, expect, pcConfig.String())
}
diff --git a/core/version.go b/core/version.go
index 95ff0f3..eacda1c 100644
--- a/core/version.go
+++ b/core/version.go
@@ -16,7 +16,7 @@
*/
package rocketmq
-const GoClientVersion = "Go Client V1.2.0, Support CPP Core:V1.2.X"
+const GoClientVersion = "Go Client V1.2.4, Support CPP Core:V1.2.X"
func GetVersion() (version string) {
return GoClientVersion
diff --git a/core/version_test.go b/core/version_test.go
index 85f43c1..a99a22d 100644
--- a/core/version_test.go
+++ b/core/version_test.go
@@ -16,15 +16,12 @@
*/
package rocketmq
-//import (
-// "fmt"
-// "testing"
-// "../client"
-//)
-//
-//func TestGetVersion(test *testing.T){
-// fmt.Println("-----TestGetVersion Start----")
-// version := rocketmq.GetVersion();
-// fmt.Println(version)
-// fmt.Println("-----TestGetVersion Finish----")
-//}
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestGetVersion(test *testing.T) {
+ expect := "Go Client V1.2.4, Support CPP Core:V1.2.X"
+ assert.Equal(test, expect, GetVersion())
+}
diff --git a/demos/main.go b/demos/main.go
new file mode 100644
index 0000000..1e325e9
--- /dev/null
+++ b/demos/main.go
@@ -0,0 +1,29 @@
+/*
+ * 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 main
+
+func main() {
+ //run producer
+ main0()
+ //run consumer
+ main1()
+ //run orderly producer
+ main2()
+ //run orderly consumer
+ main3()
+}
diff --git a/demos/orderly_push_consumer.go b/demos/orderly_push_consumer.go
index bf10055..da65d98 100644
--- a/demos/orderly_push_consumer.go
+++ b/demos/orderly_push_consumer.go
@@ -24,7 +24,8 @@
"sync/atomic"
)
-func main() {
+// Change to main if you want to run it directly
+func main3() {
pConfig := &rocketmq.PushConsumerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
diff --git a/demos/producer.go b/demos/producer.go
index a941305..ad08c12 100644
--- a/demos/producer.go
+++ b/demos/producer.go
@@ -22,7 +22,8 @@
"github.com/apache/rocketmq-client-go/core"
)
-func main() {
+// Change to main if you want to run it directly
+func main0() {
pConfig := &rocketmq.ProducerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
diff --git a/demos/producer_orderly.go b/demos/producer_orderly.go
index 7822448..6664498 100644
--- a/demos/producer_orderly.go
+++ b/demos/producer_orderly.go
@@ -22,7 +22,8 @@
"time"
)
-func main() {
+// Change to main if you want to run it directly
+func main2() {
pConfig := &rocketmq.ProducerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
diff --git a/demos/push_consumer.go b/demos/push_consumer.go
index af8a9a0..cf5feb0 100644
--- a/demos/push_consumer.go
+++ b/demos/push_consumer.go
@@ -23,7 +23,8 @@
"sync/atomic"
)
-func main() {
+// Change to main if you want to run it directly
+func main1() {
pConfig := &rocketmq.PushConsumerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",