-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rocketmq禁消费controller-wrapper、handler
Signed-off-by: daizhenyu <1449308021@qq.com>
- Loading branch information
Showing
12 changed files
with
806 additions
and
9 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
46 changes: 46 additions & 0 deletions
46
...ontroller/src/main/java/com/huaweicloud/sermant/rocketmq/cache/RocketMqConsumerCache.java
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,46 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.cache; | ||
|
||
import com.huaweicloud.sermant.rocketmq.wrapper.DefaultLitePullConsumerWrapper; | ||
import com.huaweicloud.sermant.rocketmq.wrapper.DefaultMqPushConsumerWrapper; | ||
|
||
import java.util.Set; | ||
import java.util.concurrent.CopyOnWriteArraySet; | ||
|
||
/** | ||
* rocketmq消费者缓存 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-04 | ||
**/ | ||
public class RocketMqConsumerCache { | ||
/** | ||
* push消费者wrapper缓存 | ||
*/ | ||
public static final Set<DefaultMqPushConsumerWrapper> PUSH_CONSUMERS_CACHE = | ||
new CopyOnWriteArraySet<>(); | ||
|
||
/** | ||
* pull消费者wrapper缓存 | ||
*/ | ||
public static final Set<DefaultLitePullConsumerWrapper> PULL_CONSUMERS_CACHE = | ||
new CopyOnWriteArraySet<>(); | ||
|
||
private RocketMqConsumerCache() { | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...c/main/java/com/huaweicloud/sermant/rocketmq/extension/RocketMqConsumerAssignHandler.java
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,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.extension; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext; | ||
|
||
/** | ||
* RocketMqConsumerAssign处理器接口,供外部实现在rocketmq消费者指定队列消费时执行相应操作 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-15 | ||
**/ | ||
public interface RocketMqConsumerAssignHandler { | ||
/** | ||
* 拦截点前置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doBefore(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点后置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doAfter(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点异常处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doOnThrow(ExecuteContext context); | ||
} |
48 changes: 48 additions & 0 deletions
48
...main/java/com/huaweicloud/sermant/rocketmq/extension/RocketMqConsumerShutdownHandler.java
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,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.extension; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext; | ||
|
||
/** | ||
* RocketmqConsumerShutdown处理器接口,供外部实现在rocketmq消费者关闭时执行相应操作 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-13 | ||
**/ | ||
public interface RocketMqConsumerShutdownHandler { | ||
/** | ||
* 拦截点前置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doBefore(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点后置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doAfter(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点异常处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doOnThrow(ExecuteContext context); | ||
} |
48 changes: 48 additions & 0 deletions
48
...rc/main/java/com/huaweicloud/sermant/rocketmq/extension/RocketMqConsumerStartHandler.java
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,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.extension; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext; | ||
|
||
/** | ||
* RocketmqConsumerStart处理器接口,供外部实现在rocketmq消费者启动时执行相应操作 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-13 | ||
**/ | ||
public interface RocketMqConsumerStartHandler { | ||
/** | ||
* 拦截点前置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doBefore(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点后置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doAfter(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点异常处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doOnThrow(ExecuteContext context); | ||
} |
48 changes: 48 additions & 0 deletions
48
...ain/java/com/huaweicloud/sermant/rocketmq/extension/RocketMqConsumerSubscribeHandler.java
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,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.extension; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext; | ||
|
||
/** | ||
* RocketmqConsumerSubscribe处理器接口,供外部实现在rocketmq消费者订阅时执行相应操作 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-15 | ||
**/ | ||
public interface RocketMqConsumerSubscribeHandler { | ||
/** | ||
* 拦截点前置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doBefore(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点后置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doAfter(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点异常处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doOnThrow(ExecuteContext context); | ||
} |
48 changes: 48 additions & 0 deletions
48
...n/java/com/huaweicloud/sermant/rocketmq/extension/RocketMqConsumerUnsubscribeHandler.java
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,48 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.rocketmq.extension; | ||
|
||
import com.huaweicloud.sermant.core.plugin.agent.entity.ExecuteContext; | ||
|
||
/** | ||
* RocketmqConsumerUnsubscribe处理器接口,供外部实现在rocketmq消费者取消订阅时执行相应操作 | ||
* | ||
* @author daizhenyu | ||
* @since 2023-12-15 | ||
**/ | ||
public interface RocketMqConsumerUnsubscribeHandler { | ||
/** | ||
* 拦截点前置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doBefore(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点后置处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doAfter(ExecuteContext context); | ||
|
||
/** | ||
* 拦截点异常处理 | ||
* | ||
* @param context 上下文信息 | ||
*/ | ||
void doOnThrow(ExecuteContext context); | ||
} |
Oops, something went wrong.