-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE#43]Add 4 features under simple directory (#44)
* features * Delete ConsumerGroup.feature * features * Delete bdd/src/main/resources/consumer directory * features * features * finish consumer and producer features in client, 2 sql filter features and a tag filter feature * fix a problem in SimpleConsumerInitTest.java * fix some problems in features * update * Add 4 features of SimpleConsumers scenarios * Add 4 features of SimpleConsumers scenarios --------- Co-authored-by: alani <[email protected]>
- Loading branch information
1 parent
caacf39
commit 364fc9a
Showing
7 changed files
with
471 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
bdd/src/main/resources/server/abnormal/PushConsumerRetry.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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. | ||
|
||
Feature: Test retry of PushConsumer | ||
|
||
Scenario: The normal message is sent, and after the PushConsumer partial retry, the retry message is expected to be consumed | ||
Given Create a "Normal" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a "PushConsumer", set the ClientConfiguration(Endpoint:"127.0.0.1:9876"), ConsumerGroup("random-group"), SubscriptionExpressions("random-topic", "random-FilterExpression"), ConsumptionThreadCount(20) | ||
And Set PushConsumer Listener, “half” of the number of pre-sent messages are consumed successful and return SUCCESS, another "half" are consumed failed and return FAILURE | ||
And Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("10s"), Topic("random-topic") | ||
Then Create a message, including the Topic("random-topic"), Tag("TagA"), Key("Key"), and Body("Body") | ||
And Send "10" messages "synchronous" | ||
Then Check all messages send "successfully" | ||
Then Check NoRetryMessages equals to RetryMessages and equals to "half" of the number of pre-sent messages | ||
And Check all messages are contained in retryMessages or noRetryMessages | ||
And Shutdown the producer and consumer if they are started | ||
|
||
Scenario: The send order message, after the PushConsumer partial retry, is expected to consume the retry message, and the message consumption order and send order | ||
Given Create a "FIFO" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a "PushConsumer", set the ClientConfiguration(Endpoint:"127.0.0.1:9876"), ConsumerGroup("random-group"), SubscriptionExpressions("random-topic", "random-FilterExpression"), ConsumptionThreadCount(20), and MessageListener("default") | ||
And Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("10s"), Topic("random-topic") | ||
Then Create a message, including the Topic("random-topic"), Tag("TagA"), Key("Key"), Body("Body"), and MessageGroup("group") | ||
And Send "10" messages "synchronous" | ||
Then Check all messages send "successfully" | ||
And Wait until all the messages that can be consumed | ||
And Check the order of received messages consistent with the order of pre-sent messages | ||
And Shutdown the producer and consumer if they are started | ||
|
||
Scenario: Send sequential messages, using three Shardingkeys, after partial retries, expect to consume retry messages, and the order of message consumption and the order of message delivery | ||
Given Create a "FIFO" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a "PushConsumer", set the ClientConfiguration(Endpoint:"127.0.0.1:9876"), ConsumerGroup("random-group"), SubscriptionExpressions("random-topic", "random-FilterExpression"), ConsumptionThreadCount(20), and MessageListener("default") | ||
And Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("10s"), Topic("random-topic") | ||
Then Create a message, including the Topic("random-topic"), Tag("TagA"), Key("Key"), Body("Body"), and MessageGroup("group") | ||
And Send "10" messages "synchronous" | ||
Then Check all messages send "successfully" | ||
And Wait until all the messages that can be consumed | ||
Then Separate the messages into 3 ShardingKeyGroups according to messageGroup | ||
And Check the message order in each ShardingKeyGroup | ||
And Shutdown the producer and consumer if they are started | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# 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. | ||
|
||
Feature: Test SimpleConsumer pulls normal messages and returns acks synchronously or asynchronously | ||
|
||
Scenario Outline: Send 20 normal messages synchronously and expect to consume with receive()/receiveAsync() and ack()/ackAsync() messages successfully | ||
Given Create a "Normal" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("random-group"), Topic("random-topic") | ||
And Create a SimpleConsumer, set the Endpoint("127.0.0.1:9876"), Topic("random-topic"), ConsumerGroup("group"), FilterExpressions("tag"), Duration("10s") | ||
And Create a message, including the Topic("random-topic"), Tag("TagA"), Key("Key"), and Body("Body") | ||
And Send "20" messages "synchronously" | ||
Then Check all messages send "successfully" | ||
And SimpleConsumer invokes the method receive(maxMessageNum:"1", invisibleDuration:"10s") "<TransmissionMode>" | ||
Then SimpleConsumer returns acks "<AckMode>" | ||
Then Check all "Normal" messages are received and acked within 90s "successfully" | ||
And Shutdown the producer and consumer if they are started | ||
|
||
Examples: | ||
| TransmissionMode | AckMode | | ||
| synchronously | synchronously | | ||
| asynchronously | synchronously | | ||
| synchronously | asynchronously | | ||
| asynchronously | asynchronously | | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# 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. | ||
|
||
Feature: Test SimpleConsumer pulls and ack order/delay/transaction messages synchronously properly | ||
|
||
Scenario: Send 20 order messages synchronously, expect SimpleConsumer to receive() and ack() messages properly and the order to be maintained | ||
Given Create a "FIFO" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("random-group"), Topic("random-topic") | ||
And Create a SimpleConsumer, set the Endpoint("127.0.0.1:9876"), Topic("random-topic"), ConsumerGroup("group"), FilterExpressions("tag"), Duration("10s") | ||
And Create "a" messages, including the Topic("Topic"), Tag("Tag"), Key("Key"), MessageGroup("Group"), and Body("Body") | ||
And Send "20" messages "synchronously" | ||
Then Check all messages send "successfully" | ||
And SimpleConsumer invokes the method receive(maxMessageNum:"1", invisibleDuration:"10s") "synchronously" | ||
Then SimpleConsumer returns acks "synchronously" | ||
Then Check all "FIFO" messages are received and acked within 90s "successfully" | ||
And Shutdown the producer and consumer if they are started | ||
|
||
Scenario: Send 10 delay messages synchronously, expect SimpleConsumer to receive() and ack() messages properly | ||
Given Create a "Delay" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("random-group"), Topic("random-topic") | ||
And Create a SimpleConsumer, set the Endpoint("127.0.0.1:9876"), Topic("random-topic"), ConsumerGroup("group"), FilterExpressions("tag"), Duration("10s") | ||
And Create a message, including the Topic("random-topic"), Tag("TagA"), Body("Body"), deliveryTimestamp("10s") | ||
And Send "10" messages "synchronously" | ||
Then Check all messages send "successfully" | ||
And SimpleConsumer invokes the method receive(maxMessageNum:"1", invisibleDuration:"10s") "synchronously" | ||
Then SimpleConsumer returns acks "synchronously" | ||
Then Check all "Delay" messages are received and acked within 90s "successfully" | ||
And Shutdown the producer and consumer if they are started | ||
|
||
Scenario: Send 10 transaction messages synchronously, expect SimpleConsumer to receive() and ack() messages properly | ||
Given Create a "Transaction" topic:"random-topic" if not exist, a "Concurrently" group:"random-group" | ||
When Create a Producer, set the Endpoint("127.0.0.1:9876"), RequestTimeout:("random-group"), Topic("random-topic") | ||
And Create a SimpleConsumer, set the Endpoint("127.0.0.1:9876"), Topic("random-topic"), ConsumerGroup("group"), FilterExpressions("tag"), Duration("10s") | ||
And Create a message, including the Topic("random-topic"), Tag("TagA"), Key("Key"), and Body("Body") | ||
And Send "10" messages "synchronously" | ||
Then Check all messages send "successfully" | ||
And SimpleConsumer invokes the method receive(maxMessageNum:"1", invisibleDuration:"10s") "synchronously" | ||
Then SimpleConsumer returns acks "synchronously" | ||
Then Check all "Transaction" messages are received and acked within 90s "successfully" | ||
And Shutdown the producer and consumer if they are started |
Oops, something went wrong.