diff --git a/pom.xml b/pom.xml index e57a6e2..057800a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ 17 UTF-8 UTF-8 - 3.3.1 + 4.0.5 3.4.0 8.45.1 2.43.0 diff --git a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/MessageListenerExecutor.java b/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/MessageListenerExecutor.java deleted file mode 100644 index bc3870f..0000000 --- a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/MessageListenerExecutor.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 org.apache.pulsar.client.api; - -/** - * Interface for providing service to execute message listeners. TODO Duplicate class, to be deleted - * after merging https://github.com/apache/pulsar/pull/22861 - */ -public interface MessageListenerExecutor { - - /** - * select a thread by message to execute the runnable! - * - *

Suggestions: - * - *

1. The message listener task will be submitted to this executor for execution, so the - * implementations of this interface should carefully consider execution order if sequential - * consumption is required. - * - *

2. The users should release resources(e.g. threads) of the executor after closing the - * consumer to avoid leaks. - * - * @param message the message - * @param runnable the runnable to execute, that is, the message listener task - */ - void execute(Message message, Runnable runnable); -} diff --git a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/KeySharedMessageListenerExecutor.java b/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/KeySharedMessageListenerExecutor.java index 0762572..f5b28ec 100644 --- a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/KeySharedMessageListenerExecutor.java +++ b/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/KeySharedMessageListenerExecutor.java @@ -24,7 +24,7 @@ public class KeySharedMessageListenerExecutor implements MessageListenerExecutor public KeySharedMessageListenerExecutor(int numThreads, String subscriptionName) { this.executorProvider = - new ExecutorProvider(numThreads, subscriptionName + "listener-executor-"); + new ExecutorProvider(numThreads, subscriptionName + "-listener-executor"); } @Override diff --git a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/PartitionOrderMessageListenerExecutor.java b/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/PartitionOrderMessageListenerExecutor.java index e18e496..bb95baf 100644 --- a/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/PartitionOrderMessageListenerExecutor.java +++ b/pulsar-client-common-contrib/src/main/java/org/apache/pulsar/client/api/impl/PartitionOrderMessageListenerExecutor.java @@ -23,7 +23,7 @@ public class PartitionOrderMessageListenerExecutor implements MessageListenerExe public PartitionOrderMessageListenerExecutor(int numThreads, String subscriptionName) { this.executorProvider = - new ExecutorProvider(numThreads, subscriptionName + "listener-executor-"); + new ExecutorProvider(numThreads, subscriptionName + "-listener-executor"); } @Override