diff --git a/hutool-extra/pom.xml b/hutool-extra/pom.xml index 69f5efc8e..5dd55c992 100755 --- a/hutool-extra/pom.xml +++ b/hutool-extra/pom.xml @@ -551,5 +551,24 @@ 3.0.2 provided + + + org.apache.kafka + kafka-clients + 3.9.0 + provided + + + org.apache.activemq + activemq-client + 6.1.5 + provided + + + com.rabbitmq + amqp-client + 5.24.0 + provided + diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Consumer.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Consumer.java new file mode 100644 index 000000000..8fd000cf8 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Consumer.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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.dromara.hutool.extra.mq; + +public interface Consumer { +} diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Message.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Message.java new file mode 100644 index 000000000..6b2e3b5e4 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Message.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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.dromara.hutool.extra.mq; + +public interface Message { +} diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Producer.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Producer.java new file mode 100644 index 000000000..4fa21b586 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/Producer.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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.dromara.hutool.extra.mq; + +public interface Producer { + void send(Message message); +} diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngine.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngine.java new file mode 100644 index 000000000..9db95ff03 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngine.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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.dromara.hutool.extra.mq.engine; + +public interface MQEngine { +} diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngineFactory.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngineFactory.java new file mode 100644 index 000000000..ff75e40fe --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/MQEngineFactory.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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.dromara.hutool.extra.mq.engine; + +public class MQEngineFactory { +} diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/activemq/package-info.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/activemq/package-info.java new file mode 100644 index 000000000..311af9dbf --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/activemq/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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. + */ + +/** + * ActiveMQ消息队列引擎实现 + * + * @author Looly + */ +package org.dromara.hutool.extra.mq.engine.activemq; diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/kafka/package-info.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/kafka/package-info.java new file mode 100644 index 000000000..aac5019d2 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/kafka/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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. + */ + +/** + * Kafka消息队列引擎 + * + * @author Looly + * @since 6.0.0 + */ +package org.dromara.hutool.extra.mq.engine.kafka; diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/package-info.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/package-info.java new file mode 100644 index 000000000..3d4676bf7 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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. + */ + +/** + * 消息队列引擎实现 + * + * @author Looly + */ +package org.dromara.hutool.extra.mq.engine; diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/rabbitmq/package-info.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/rabbitmq/package-info.java new file mode 100644 index 000000000..010d7abdc --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/engine/rabbitmq/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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. + */ + +/** + * RabbitMQ消息队列引擎 + * + * @author Looly + * @since 6.0.0 + */ +package org.dromara.hutool.extra.mq.engine.rabbitmq; diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/package-info.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/package-info.java new file mode 100644 index 000000000..82141fa67 --- /dev/null +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/mq/package-info.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2025 Hutool Team and hutool.cn + * + * 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. + */ + +/** + * MQ(message queue)(消息队列)门面封装
+ * 通过定义统一接口,统一消息中间件的调用,实现消息队列的解耦。 + * 组件包括: + * + * + * @author Looly + * @since 6.0.0 + */ +package org.dromara.hutool.extra.mq;